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.
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
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:
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 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.