package installation error with 'mapview' package

944 Views Asked by At

I am trying to install the 'mapview' package in R. I tried restarting R, clearing the environment, terminating all the sessions, and restarting and with a totally new session.But I keep getting same error message:

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace ‘terra’ 1.4-11 is being loaded, but >= 1.5.12 is required
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘mapview’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mapview’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mapview’
Warning in install.packages :
  installation of package ‘mapview’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/hc/5lcwxt3j5xg0bnng9j68qms00000gn/T/RtmpUa3EvN/downloaded_packages’
1

There are 1 best solutions below

0
Caspar V. On

The error Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace ‘≪package≫’ ≪versionX≫ is being loaded, but >= ≪versionY≫ is required means that the package ≪package≫ ís present but outdated, and can therefore not be loaded successfully.

Updating CRAN packages in R

You can update the package terra by reinstalling it:

install.packages('terra')

Or slightly more interactive with:

update.packages(oldPkgs='terra')

Or in RStudio through Tools > Check for Package Updates...

Update all CRAN packages

You can update all your packages with:

update.packages()

Or through RStudio as mentioned above.