Search code examples
yarnpkg

Why won't Yarn run scripts from the package.json?


My npm scripts are not working with Yarn.

Normally I would run npm start or npm run buildand the scripts would execute successfully. When I try and run these with yarn start / yarn run start / yarn run build I get errors:

yarn start v0.15.1
$ "node server" 
sh: node server: command not found
error Command failed with exit code 127.

I installed Yarn globally through npm. Running zsh in terminal.

Update: Looks like this was a v0.15.1 bug and is no longer an issue in 0.16.*


Solution

  • Update your yarn package with npm or reinstall using brew.

    I'm using nvm for npm/node and I had the same problem with v0.15.1. Solved it by upgrading yarn to v0.16.1.