1

I get the following error after trying to install 'devtools' via install.packages('devtools').

n R CMD INSTALL

  • installing source package 'waldo' ... ** package 'waldo' successfully unpacked and MD5 sums checked ** R ** 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 >= 1.0.0 is required ERROR: lazy loading failed for package 'waldo'
  • removing 'C:/Users/USER/Documents/R/win-library/3.5/waldo' In R CMD INSTALL
  • installing source package 'callr' ... ** package 'callr' successfully unpacked and MD5 sums checked ** R ** inst ** byte-compile and prepare package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'processx' 3.4.2 is being loaded, but >= 3.6.1 is required ERROR: lazy loading failed for package 'callr'
  • removing 'C:/Users/USER/Documents/R/win-library/3.5/callr' In R CMD INSTALL
  • 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 'C:/Users/USER/Documents/R/win-library/3.5/lifecycle' In R CMD INSTALL ERROR: dependency 'cachem' is not available for package 'memoise'
  • removing 'C:/Users/USER/Documents/R/win-library/3.5/memoise' In R CMD INSTALL
  • installing source package 'sessioninfo' ... ** package 'sessioninfo' successfully unpacked and MD5 sums checked ** R ** byte-compile and prepare package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'cli' 2.0.2 is being loaded, but >= 3.1.0 is required ERROR: lazy loading failed for package 'sessioninfo'
  • removing 'C:/Users/USER/Documents/R/win-library/3.5/sessioninfo' In R CMD INSTALL
  • installing source package 'usethis' ... ** package 'usethis' 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 >= 1.0.0 is required ERROR: lazy loading failed for package 'usethis'
  • removing 'C:/Users/USER/Documents/R/win-library/3.5/usethis' In R CMD INSTALL ERROR: dependency 'sessioninfo' is not available for package 'rcmdcheck'
  • removing 'C:/Users/USER/Documents/R/win-library/3.5/rcmdcheck' In R CMD INSTALL ERROR: dependencies 'usethis', 'rcmdcheck', 'sessioninfo' are not available for package > 'devtools'
  • removing 'C:/Users/USER/Documents/R/win-library/3.5/devtools'

The downloaded source packages are in 'C:\Users\USER\AppData\Local\Temp\RtmpSGxpAV\downloaded_packages' Warning messages: 1: In install.packages("devtools") : installation of package 'waldo' had non-zero exit status 2: In install.packages("devtools") : installation of package 'callr' had non-zero exit status 3: In install.packages("devtools") : installation of package 'lifecycle' had non-zero exit status 4: In install.packages("devtools") : installation of package 'memoise' had non-zero exit status 5: In install.packages("devtools") : installation of package 'sessioninfo' had non-zero exit status 6: In install.packages("devtools") : installation of package 'usethis' had non-zero exit status 7: In install.packages("devtools") : installation of package 'rcmdcheck' had non-zero exit status 8: In install.packages("devtools") : installation of package 'devtools' had non-zero exit status

After analyzing the error message, I realized that all the source packages ended with 'tar.gz' seem not to be decompressed as folders.

What should I install prior to running the install.packages('devtools') command?

and finally, how can I install 'devtools' automatically?

vvvvv
  • 25,404
  • 19
  • 49
  • 81
Sophia Lyu
  • 21
  • 6
  • I am not sure what you mean by installing `devtools` automatically - you can always create a list of packages that will be installed/loaded on startup - look [here](https://stackoverflow.com/questions/10300769/how-to-load-packages-in-r-automatically) as for installing from a tar.gz file you can use `install.packages(path_to_file, repos = NULL, type="source")` - it always works for me, but be aware you need `rtools` for it to work – D.J Jul 18 '22 at 06:13
  • thanks! I didn't understand perfectly the way R functions. – Sophia Lyu Jul 18 '22 at 08:43

1 Answers1

1

I solved my problem by using this command.

install.packages("devtools", type="binary")

I don't know why it was resolved.

But, I noticed that it is related to installing 'source' packages after trying to install other packages like 'tidyvere' or 'dplyr'. Conversely, 'binary' packages were OK.

This result is from the terminal after running install.packages ('tidyverse').

There are binary versions available but the source versions are later:
          binary source needs_compilation
processx       3.4.2  3.7.0              TRUE
htmltools      0.4.0  0.5.2              TRUE
sass           0.2.0  0.4.2              TRUE
glue           1.4.0  1.6.2              TRUE
lifecycle      0.2.0  1.0.1             FALSE
vctrs          0.2.4  0.4.1              TRUE
tidyselect     1.0.0  1.1.2              TRUE
data.table    1.12.8 1.14.2              TRUE
gargle         0.4.0  1.2.0             FALSE
ellipsis       0.3.0  0.3.2              TRUE
vroom          1.2.0  1.5.7              TRUE
callr          3.4.3  3.7.1             FALSE
tinytex         0.22   0.40             FALSE
xfun            0.13   0.31              TRUE

Here is the summary of my error message.

Error 1: 'rlang' is the example packages getting dependencies error.

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 2: 'lifecycle' is the example packages getting lazy loading failure error.

ERROR: lazy loading failed for package 'lifecycle'
* removing 'C:/Users/USER/Documents/R/win-library/3.5/lifecycle'
* restoring previous 'C:/Users/USER/Documents/R/win-library/3.5/lifecycle'
Sophia Lyu
  • 21
  • 6