6

I have to run a script (from my package.json file) before I run yarn install. The script sets up the configuration for a private package. In my .yarnrc.yml, I have nodeLinker: node-modules (and I want to keep it that way because I get other errors if I remove it).

The problem is that when I run yarn run myscript I have the following error:

Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...

But I can't run install before the script since I have private packages that need the script before it gets installed.

I just switched from NPM to Yarn 3.2.0. With NPM, I was able to run the script before installing packages.

Nate
  • 7,606
  • 23
  • 72
  • 124

0 Answers0