tidyverse cannot be called because of "cli" (Permission denied)

Hello folks.
I am a bit sick of Rstudio's permissions issues.

I have problems with permissions with RStudio so i install and update packages using the R GUI.
I recently updated multiple packages but even via R i get permission denied for "cli". That just caused a problem using the tidyverse packages.

I tried all sorts of permission settings in my computer, running as administrator and all.
The only thing that worked so far was installing new packages with R and then use them normally in RStudio. now updating packages ■■■■ed my already existing and working tools.
Any suggestions?

you've written permission denied, but that phrase doesnt appear in the screenshot you posted.
the screenshot does not relate to permissions.
it relates to an attempt to use a package ('tidyverse') that requires a dependency (package 'cli') to be installed on the system , and available for it to use in turn. it wants version 3.3.0
you don't have 3.3.0 you have 3.2.0
you should install 3.3.0 cli and then try load tidyverse package again.

Thank you. I can't install the newer version due to permission issues..

please provide the text of your installation error relating to cli (best as pure text, not as screenshot, there is a code embed button in this forum editor / or you can engage it with Ctrl+E on a windows PC.)

install.packages("cli")
Installing package into ‘C:/Users/97253/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/cli_3.3.0.zip'
Content type 'application/zip' length 1259538 bytes (1.2 MB)
downloaded 1.2 MB

Error in install.packages : cannot open file 'C:/Users/97253/Documents/R/win-library/4.1/file25a823291ce7/cli/logo.txt': Permission denied

I manualy doenloaded cli and unzipped it,
Still get this msg when trying to install tidyverse:
Error in install.packages : cannot open file 'C:/Users/97253/Documents/R/win-library/4.1/file25a83b0045f0/tidyverse/help/figures/logo.png': Permission denied

It is so frustrating because I actually do have cli 3.3.0
image
):

So no basically it gives me this error and for some reason it cannot install these packgaes manually:

Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘dplyr’ 1.0.8 is already loaded, but >= 1.0.9 is required

I have seen this happening before because of Windows Security's Real-time protection preventing installation silently. The solution for those cases was to white list R and RStudio.

1 Like

I had similar problems in the past.

Uninstall the package.

And manually download the cli version you need from the repository:
https://cran.r-project.org/src/contrib/Archive/cli/

Install the new version manually.

I hope this helps

This is what we do at our firm - this happens frequently for libraries that rely on compiled code.

Nothing meaningful to add to the conversation from me, just a note that getting your IT to whitelist R and RStudio will save you a lot of headaches.

1 Like

If anyone is interested, I am now using this as my go-to solution:

First, removing the package remove.packages("tibble")

Then, downloading the package using the installr package,

and then install.packages.zip function.

install.packages.zip("https://cran.r-project.org/bin/windows/contrib/r-release/tibble_3.1.8.zip")
# Or:
install.packages.zip("https://cran.r-project.org/bin/windows/contrib/r-release/YOURPACKAGE_6.6.6.zip")

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.