Skip to content

Windows path conflict: %localappdata%/R/cache/R/renv/index #2152

@AlexTate

Description

@AlexTate

A colleague recently ran into an issue installing packages in an renv managed environment on Windows 11. They reported that the following error was produced for any package installation, but for this particular output we were attempting to install workflowr:

> install.packages("workflowr")
# Downloading packages -------------------------------------------------------
Warning: failed to create directory at path 'C:\Users\user\AppData\Local/R/cache/R/renv/index/R-4.2/x86_64-w64-mingw32/available-packages'
Warning in entry[[key]] : wrong arguments for subsetting an environment
Warning: failed to create directory at path 'C:\Users\user\AppData\Local/R/cache/R/renv/index/R-4.2/x86_64-w64-mingw32/available-packages'
Warning in file.path(repo, "src/contrib/Archive", Package) :
  object 'Package' not found
Error: failed to retrieve package ''

We found that this was because the directory C:\Users\user\AppData\Local/R/cache/R/renv already contained an INDEX file typical of R package structure, and since Windows treats paths as case-insensitive, the intermediate directory index couldn't be created. After renaming the resident file to _INDEX all installations proceeded without issue.

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