Can't update any packages - lazy loading failed

Most of my packages need updating, but each one gives me the 'lazy loading failed' error. What should be the first thing I try to do to resolve the issue? I have not encountered this issue before. Also, should I update or reinstall both my R version and my RStudio version?

R version: 4.0.3
RStudio (desktop) version: 2021.09.0 Build 351, "Ghost Orchid" Release (077589bc, 2021-09-20) for Windows
OS: Windows 10

I have only used R off and on back in school, but I now plan to learn it more thoroughly on my own by working through a textbook. I also would like to use R-Bookdown to create some html output for my website.

From the console:

install.packages("broom")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/admin/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
broom 0.8.0 1.0.1 FALSE

installing the source package ‘broom’

trying URL 'https://cran.rstudio.com/src/contrib/broom_1.0.1.tar.gz'
Content type 'application/x-gzip' length 642253 bytes (627 KB)
downloaded 627 KB

  • installing source package 'broom' ...
    ** package 'broom' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    namespace 'lifecycle' 1.0.0 is being loaded, but >= 1.0.1 is required
    Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package 'broom'
  • removing 'C:/Users/admin/Documents/R/win-library/4.0/broom'
  • restoring previous 'C:/Users/admin/Documents/R/win-library/4.0/broom'
    Warning in install.packages :
    installation of package ‘broom’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\admin\AppData\Local\Temp\RtmpEjevk7\downloaded_packages’

Try declining the option to install the source version; otherwise, you must install RTools and maintain the Windows software development tools.

I did options(pkgType = "binary") and then ran update.packages(). It worked perfectly to update most of the packages.

For the other package types, source, I installed RTools. That worked perfectly too.

2 Likes

This topic was automatically closed 7 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.