Skip to content

snapshot does not report missing packages when renv.verbose = FALSE #1607

@aronatkins

Description

@aronatkins

Use a non-renv project where the R library does not contain a package. In my case, the R library is missing tidyr and there is an R file containing a library(tidyr) statement.

options(renv.verbose = FALSE)
deps <- renv::dependencies(getwd())
renv::snapshot(getwd(), packages = deps$Package, prompt = FALSE)
#> What do you want to do? 
#> 
#> 1: Snapshot, just using the currently installed packages.
#> 2: Install the packages, then snapshot.
#> 3: Cancel, and resolve the situation on your own.
#> 
#> Selection: 3
#> - Operation canceled.
options(renv.verbose = NULL)
renv::snapshot(getwd(), packages = deps$Package, prompt = FALSE)
#> The following required packages are not installed:
#> - tidyr
#> Packages must first be installed before renv can snapshot them.
#> Use `renv::dependencies()` to see where this package is used in your project.
#> 
#> What do you want to do? 
#> 
#> 1: Snapshot, just using the currently installed packages.
#> 2: Install the packages, then snapshot.
#> 3: Cancel, and resolve the situation on your own.
#> 
#> Selection: 3
#> - Operation canceled.

When run in a non-interactive session, the output is even less helpful:

- Operation canceled.
Execution halted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions