Knitting R markdown rlang problem

I am trying to knitting an R markdown document into an html file. However, I get the following error:

Error: package or namespace load failed for 'tidyverse' 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 Execution halted

After trying to re-install lifecycle with the following command

devtools::install_github("r-lib/lifecycle")

I get a simmilar error with rlang:

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace ‘rlang’ 1.0.2 is being loaded, but >= 1.1.0 is required Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace Execution halted ERROR: lazy loading failed for package ‘lifecycle’

  • removing ‘/Users/name/Library/R/4.0/library/lifecycle’ Error: Failed to install 'lifecycle' from GitHub: (converted from warning) installation of package ‘/var/folders/gj/xz0j3hnd6z9gxbs79ply8nm00000gn/T//RtmpotiD17/filee36f2c2ec74/lifecycle_1.0.3.9000.tar.gz’ had non-zero exit status

I think there is an issue with the versions of my packages but I do not know how to solve it / why this has suddenly occurred.

Now, it's asking

install.packages("rlang")

There's no guarantee that rlang won't require its own missing dependency be installed/updated. It's annoying. I try to minimize by running

update.packages(ask = FALSE)

frequently.

Trying to install rlang again gives the following error:

Error in install.packages : Updating loaded packages

After running then:
update.packages(ask=FALSE)

The following error comes up:
Warning: package ‘ggplot2’ was built under R version 4.3.0
Error: package or namespace load failed for ‘tidyverse’:
.onAttach failed in attachNamespace() for 'tidyverse', details:
call: NULL
error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 1.0.2 is being loaded, but >= 1.1.0 is required
Error: loading failed
Execution halted
ERROR: loading failed

  • removing ‘/Users/ name/Library/R/4.0/library/tidyverse’
  • restoring previous ‘/Users/name/Library/R/4.0/library/tidyverse’

The downloaded source packages are in
‘/private/var/folders/gj/xz0j3hnd6z9gxbs79ply8nm00000gn/T/RtmpEQfYyq/downloaded_packages’
Warning in install.packages(update[instlib == l, "Package"], l, repos = repos, :
'lib = "/Library/Frameworks/R.framework/Versions/4.0/Resources/library"' is not writable
Would you like to use a personal library instead? (yes/No/cancel) no
Error in install.packages(update[instlib == l, "Package"], l, repos = repos, :
unable to install packages

And if, regardless, I now try to knit my markdown to html. I get the following new error:

Error in xfun::normalize_path(path, ..., must_work = must_work, resolve_symlink = FALSE) :
unused argument (resolve_symlink = FALSE)
Calls: -> normalize_path
Execution halted

What version of rlang is showing from SessionInfo()?

rlang_0.4.11

I just don't know why the re-installation of rlang did not update its version.

Yeah. That's odd. Are you Intel or Silicon? Do you happen to use Anaconda as a backend package manager? If you were offered the "binary version is available but a source version is later" did you answer yes?

I'm Intel and just using R studio (not the Anaconda one).

I now get this error: Error in xfun::normalize_path(path, ..., must_work = must_work, resolve_symlink = FALSE) :
unused argument (resolve_symlink = FALSE)
Calls: -> normalize_path
Execution halted

When I try to uninstall and install with:

remove.packages('xfun')

install.packages("xfun")

And say 'Yes' install from sources that need compilation, I get the following error:

  • installing source package ‘xfun’ ...
    ** package ‘xfun’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** 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 ‘/Users/name/Library/R/4.0/library/xfun’
    Warning in install.packages :
    installation of package ‘xfun’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/gj/xz0j3hnd6z9gxbs79ply8nm00000gn/T/RtmpoF0zBb/downloaded_packages’

I ended up uninstalling R, R studio and deleting all the related files in my computer library (from packages) and re-installing everything. It now works fine.

For the record, RStudio has nothing to do with this, and it does not make much sense reinstalling RStudio, or even R itself.

Cleaning up the package libraries indeed makes sense on the other hand.

1 Like

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.