npm script command to run a script command from another package.json
You should use --prefix
.
npm run [command] --prefix path/to/your/other/folder
And for yarn:
yarn --cwd path/to/your/other/folder [command]
well it turns out to be quite simple:
"scripts": {
test_projectA:"cd ../projectA && npm run-script test"
}
I ended up using:
"scripts": {
"job": "cd ./sub && \"$npm_execpath\" run subjob",
...
}
because this also works with yarn.