RStudio freaked out on me today - can't update rlang package

I need to use devtools, every time i type in library(devtools) i get this error message:

Error: .onLoad failed in loadNamespace() for 'pkgload', details:
call: loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
error: namespace ‘rlang’ 0.4.0 is already loaded, but >= 0.4.1 is required

I have tried multiple times to update the package. I've tried other site suggestions. To no avail.

Please help!
Thanks in advance.

Without going into the root cause of the problem, have you tried to update your package using remotes::install_github("r-lib/rlang")?

The error message is asking you to update rlang What happens when you try to update it? Do you get any error message? If so please post the whole error message here as formatted code.

install.packages("rlang")

This is what i get when trying this code:

Installing package into ‘C:/Users/Channen/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)

  • installing source package 'rlang' ...
    ERROR: cannot remove earlier installation, is it in use?
  • removing 'C:/Users/Channen/Documents/R/win-library/3.6/rlang'
  • restoring previous 'C:/Users/Channen/Documents/R/win-library/3.6/rlang'
    Error in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
    (converted from warning) problem copying C:\Users\Channen\Documents\R\win-library\3.6\00LOCK-rlang\rlang\libs\x64\rlang.dll to C:\Users\Channen\Documents\R\win-library\3.6\rlang\libs\x64\rlang.dll: Permission denied
  • removing 'C:/Users/Channen/Documents/R/win-library/3.6/rlang'
  • restoring previous 'C:/Users/Channen/Documents/R/win-library/3.6/rlang'
    Error in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
    (converted from warning) problem copying C:\Users\Channen\Documents\R\win-library\3.6\00LOCK-rlang\rlang\libs\x64\rlang.dll to C:\Users\Channen\Documents\R\win-library\3.6\rlang\libs\x64\rlang.dll: Permission denied
    Execution halted
    Error: Failed to install 'rlang' from GitHub:
    (converted from warning) installation of package ‘C:/Users/Channen/AppData/Local/Temp/RtmpuMc3s0/file54383981e0/rlang_0.4.3.tar.gz’ had non-zero exit status

So, turns out I needed to install the 'lmerTest' package again....then I was able to update 'rlang'.

How silly!

Sorry, and thank you for your help!

1 Like

Very unlikely that this is the cause (maybe you restarted your R session?) but nevertheless I'm glad you're issue is solved now.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.