0

I have Rv4.2.2, Rstudio 2022.07.2-576, Rtools 4.3, and windows 10. I am attempting to install an old version of a package (specifically wdman) in order to hopefully solve an issue with RSelenium. However, I am getting an error that installation of the package had a non-zero exit status. I have tried with multiple different packages, so the issue seems to be with the methods of installation rather than in the package itself.

I have tried several different methods of installing packages, including all of those shown here. These methods include using

# 1 -----
devtools::install_version("wdman", version = "0.2.5", repos = "http://cran.us.r-project.org")

# 2 -----
remotes::install_version("wdman", version = "0.2.5", repos = "http://cran.us.r-project.org")

# 3 -----
url <- "https://cran.r-project.org/src/contrib/Archive/wdman/wdman_0.2.5.tar.gz"
pkgFile <- "wdman_0.2.5.tar.gz"
install.packages(pkgs=pkgFile, type="source", repos=NULL)

I have also tried installing through the install button in the packages window in RStudio. I specifically get an output saying:

Downloading package from url: http://cran.us.r-project.org/src/contrib/Archive/wdman/wdman_0.2.5.tar.gz
Installing package into ‘C:/Users/sck11/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/sck11/AppData/Local/Temp/RtmpmWqVmX/remotese545bc06de0/wdman’ had non-zero exit status

I am not sure what else to try, as every method of installing the old package versions either gives me this error or just says that the installation had a non-zero exit status. In addition to different installation methods I have also tried adjusting firewall settings to make sure that this is not blocking the installation, but no success there either. Any help would be greatly appreciated.

MrFlick
  • 195,160
  • 17
  • 277
  • 295
sk21
  • 1
  • 1
  • It seems odd to have RTools 4.3 when you are only using R 4.2. But is there really no other output? Especially with the `install.packages(...)` command. Are there no other errors before it prints the "non-zero exit" line? Usually there is a more specific error message that displays in the console. – MrFlick Feb 15 '23 at 19:46
  • This is the full output from `install.packages(url, repos=NULL, type="source")` (url is the same as above): `Installing package into ‘C:/Users/sck11/AppData/Local/R/win-library/4.2’ (as ‘lib’ is unspecified) trying URL 'https://cran.r-project.org/src/contrib/Archive/wdman/wdman_0.2.5.tar.gz' Content type 'application/x-gzip' length 28578 bytes (27 KB) downloaded 27 KB Warning in install.packages : installation of package ‘C:/Users/sck11/AppData/Local/Temp/RtmpmWqVmX/downloaded_packages/wdman_0.2.5.tar.gz’ had non-zero exit status` – sk21 Feb 15 '23 at 19:59
  • 1
    1 and 2 are the same thing; devtools just re-exports the remotes function. But I would avoid the `cran.us.r-project.org` repository -- I've had trouble with it in the past. I'd also avoid `http:`, and use `https:`. Generally I use `https://cloud.r-project.org`, which used to be `cran.rstudio.com`. – user2554330 Feb 15 '23 at 20:19
  • Well, with #3, it should have `download.file(url, pkgFile)` and then `install.packages(pkgFile, repos=NULL, type="source")` with `pckFile`, not `url`. But I'm still really surprised there's not a more specific error message that that's being printed. Normally there's something else going on. – MrFlick Feb 15 '23 at 20:24
  • Unfortunately none of these fixes from @user2554330 are working for me- using install_version I am still getting the `Downloading package from url: https://cran.us.r-project.org/src/contrib/Archive/wdman/wdman_0.2.5.tar.gz Installing package into ‘C:/Users/sck11/AppData/Local/R/win-library/4.2’ (as ‘lib’ is unspecified) Warning message: In i.p(...) : installation of package ‘C:/Users/sck11/AppData/Local/Temp/Rtmpgtwn16/remotes40a04a2c1780/wdman’ had non-zero exit status` error. ` As for why there is no further output I am really stumped. I tried using Rtools 4.2 but no changes with that – sk21 Feb 15 '23 at 20:55
  • You are still using the `cran.us` repository, but I just tried that URL, and it worked for me. So it's something else. You'll get more informative error messages if you download the package, then at a terminal, run `R CMD INSTALL wdman_0.2.5.tar.gz`. – user2554330 Feb 15 '23 at 21:45
  • I also tried with the 'https://cloud.r-project.org' link and no success. I am trying to install using terminal, and after restarting R the package is not showing up to the packages tab in rstudio and when I attempt 'library(wdman)' I get the error: 'Error in library(wdman) : ‘wdman’ is not a valid installed package'. The package folder initially went into my docs folder rather than R library so I moved it myself which may be where I went wrong. Any pointers in the right direction of how to complete this installation would be very helpful! – sk21 Feb 16 '23 at 14:32
  • On Windows people often have one library installed using admin privileges, and another with user privileges. You can run R as admin to install with admin privileges, or tell R to look in both places using `.libPaths( ... )`. – user2554330 Feb 16 '23 at 19:21
  • I ended up using 'devtools::load_all("~/wdman")' to load my package, nothing else would work even with the command line. Thank you all for the help! – sk21 Feb 21 '23 at 18:46

0 Answers0