I've just started to encounter the "had non-zero exit status" error when trying to install a package. This holds true for readr
(below) and ggplot2
.
Weirdly enough, the packages have previously (previous R session 5 minutes earlier) been loaded and used, but when loading them now, it generally results in the following error:
> library(readr)
Error: package or namespace load failed for ‘readr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘pillar’
When trying to install the package again, it results in the following error;:
> install.packages('readr')
Error in install.packages : Updating loaded packages
Restarting R session...
> install.packages("readr")
also installing the dependencies ‘rlang’, ‘vroom’, ‘lifecycle’, ‘tzdb’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.4.5 0.4.11 TRUE
vroom 1.2.0 1.5.4 TRUE
lifecycle 0.2.0 1.0.0 FALSE
readr 1.3.1 2.0.1 TRUE
Do you want to install from sources the packages which need compilation? (Yes/no/cancel) No
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘tzdb’
Do you want to attempt to install these from sources? (Yes/no/cancel) No
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/rlang_0.4.5.tgz'
Content type 'application/x-gzip' length 1171073 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/vroom_1.2.0.tgz'
Content type 'application/x-gzip' length 2384663 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/readr_1.3.1.tgz'
Content type 'application/x-gzip' length 777189 bytes (758 KB)
==================================================
downloaded 758 KB
The downloaded binary packages are in
/var/folders/kp/nyzw767n0qx2wpfwgplzg1bh0000gp/T//Rtmpu5HwNO/downloaded_packages
installing the source package ‘lifecycle’
trying URL 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.0.tar.gz'
Content type 'application/x-gzip' length 83389 bytes (81 KB)
==================================================
downloaded 81 KB
* installing *source* package ‘lifecycle’ ...
** package ‘lifecycle’ successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘rlang’ 0.4.5 is being loaded, but >= 0.4.10 is required
ERROR: lazy loading failed for package ‘lifecycle’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/lifecycle’
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/kp/nyzw767n0qx2wpfwgplzg1bh0000gp/T/Rtmpu5HwNO/downloaded_packages’
I've tried other suggestions in this forum, but none seemed to work for me (a. o. this or this).
I am using MacOS Big Sur and RStudio.