Chicago1988
Chicago1988

Reputation: 686

How to troubleshoot Error: Could not find package root?

I am running the command: devtools::use_testthat()

and I get the error:

Error: Could not find package root.

enter image description here

Why this happens?

Upvotes: 14

Views: 16778

Answers (2)

zabala
zabala

Reputation: 133

My problem was very similar, but running devtools::document(setwd(...)). The only thing that worked for me:

  1. I copied the DESCRIPTION file from another package (https://github.com/filipezabala/voice);
  2. I ran devtools::document(setwd(...)) again;
  3. After that, I edited the DESCRIPTION file and ran again devtools::document(setwd(...)).

Upvotes: 5

tim
tim

Reputation: 3608

devtools appears now to require the user to setwd("~/path/to/package"), even if functions like devtools::release() have the pkg= parameter set correctly.

Upvotes: 8

Related Questions