Skip to content

Weird installation error if installing to a different lib that is not on the lib path #1987

@gaborcsardi

Description

@gaborcsardi

For this you need the dev version (or just a different version, really) of usethis in a regular library, and then install usethis and devtools to another library. E.g.

dir.create(lib1 <- tempfile())
pak::pkg_install("r-lib/usethis", ask = FALSE, lib = lib1)
.libPaths(c(lib1, .libPaths()))

library(usethis)
dir.create(lib2 <- tempfile())
install.packages(c("devtools", "usethis"), lib = lib2)
** testing if installed package can be loaded
Error: package or namespace load failed for 'devtools':
 .onAttach failed in attachNamespace() for 'devtools', details:
  call: value[[3L]](cond)
  error: Package 'usethis' version 1.4.0 cannot be unloaded:
 Error in unloadNamespace(package) : namespace 'usethis' is imported by 'devtools' so cannot be unloaded

Error: loading failed
Execution halted
ERROR: loading failed

Is there a reason why devtools can't simply just depend on usethis?

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