Unable to update "cli" package to allow loading of tidyr package

As described above. I get this initial error:

Warning: package ‘tidyr’ was built under R version 4.2.3Error: package or namespace load failed for ‘tidyr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘cli’ 3.4.1 is already loaded, but >= 3.6.1 is required

If I try to install the cli package, it RStudio goes into a loop prompting a restart over and over. If I exit the loop (select "No" when prompted to restart), I get the same error again when I try to load tidyr.

So... tried to detach cli as per a suggestion from ChatGPT but I keep getting errors:

detach("package:cli", unload = TRUE)
Error in detach("package:cli", unload = TRUE) : invalid 'name' argument
detach("package:cli", character.only = TRUE)
Error in detach("package:cli", character.only = TRUE) :
invalid 'name' argument

Any help in getting the tidyr package loaded would be greatly appreciated.

Note I am an R newbie but previous programming experience many moons ago.

I had a similar issue. I completley delted cli from the library,
then manualy installed using this link https://cran.r-project.org/src/contrib/cli_3.6.2.tar.gz

you can also use the binaries
CRAN - Package cli (r-project.org)

not sure if this is the correct way to go but it did the trick for me.
Also here some good info for a similar issue:
r - How to install a package from a download zip file - Stack Overflow

Thanks, the complete deletion and manual install worked, no issue loading tidyr now.

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.