AnjaM
AnjaM

Reputation: 3039

renv::restore() failed to retrieve older package version

I am using renv for a project where I need to use an old version of mongolite (version 1.0). I can install this version with remotes::install_version("mongolite", "1.0"). However, renv fails to install this package upon renv::restore(). I tried to insert explicite sources into the lock-file like this:

"mongolite": {
      "Package": "mongolite",
      "Version": "1.0.0",
      "Source": "https://cran.rstudio.com/src/contrib/Archive/mongolite/mongolite_1.0.tar.gz"
    }

(I also tried https://github.com/jeroen/mongolite/archive/refs/tags/v1.0.tar.gz). It just didn't work (Error: failed to retrieve package 'mongolite' ). I also tried to set Sys.setenv(RENV_DOWNLOAD_FILE_METHOD = getOption("download.file.method")) like suggested in the FAQ, but this didn't help either.

Is there anything else I could try?

Upvotes: 1

Views: 672

Answers (1)

Kevin Ushey
Kevin Ushey

Reputation: 21285

It would help if you posted the entire output you saw on the failure of renv::restore(). The only thing that stands out to me is that the version is 1.0, not 1.0.0, so that could be why renv is failing to find the package (assuming you're manually modifying the lockfile).

Upvotes: 2

Related Questions