Non-zero exit status errors after updating to RStudio 1.4.1106

I recently updated RStudio to version 1.4.1106 for MaC. I have since had trouble updating various packages or reinstalling ones I had used on the old version. I always get a "had non-zero exit status" error, because of mistakes with dependent packages.

This happens for knitr, devtools and various other packages.

What's the best way forward?

Any tips welcome!

Here a sample of the code for what happens when installing the knitr package. (I edited out some bits at [...] to remove excessive links.)

> install.packages("knitr")
also installing the dependencies ‘highr’, ‘xfun’


  There are binary versions available but the source versions are later:
      binary source needs_compilation
highr    0.8    0.9             FALSE
xfun    0.12   0.22             FALSE
knitr   1.28   1.33             FALSE

installing the source packages ‘highr’, ‘xfun’, ‘knitr’

versuche URL 'https://cran.rstudio.com/src/contrib/highr_0.9.tar.gz'
Content type 'application/x-gzip' length 15188 bytes (14 KB)
==================================================
downloaded 14 KB

[...]



* installing *source* package ‘xfun’ ...
** Paket ‘xfun’ erfolgreich entpackt und MD5 Summen überprüft
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘xfun’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/xfun’
Warning in install.packages :
  installation of package ‘xfun’ had non-zero exit status
ERROR: dependency ‘xfun’ is not available for package ‘highr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/highr’
Warning in install.packages :
  installation of package ‘highr’ had non-zero exit status
ERROR: dependencies ‘highr’, ‘xfun’ are not available for package ‘knitr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/knitr’
Warning in install.packages :
  installation of package ‘knitr’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/0g/f87lw7wj4_z3f_5wdztmkw080000gn/T/Rtmp8Bm926/downloaded_packages’

This is not related to your RStudio version, which is only an IDE for the R programming language, and has nothing to do with your R package library.

The error message is telling you that you don't have Xcode installed in your system for compiling packages from source and since you are using a very old R version (latest stable version is 4.0.5) you are forced to do so if you want the latest package versions.

To solve this, install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

Also o would recommend updating your R version so you can get access to precompiled binaries which are easier to install.

Thanks for the response and helpful explanation.

Simply updating R was effective in about 90% of the packages.

I will the Xcode tip as well.

Thx!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.