You have a couple of options here, besides installing npm-run-all
as a global package as suggested by @Vaibhav in the comments:
1) Create an NPM script
The package.json
file has a scripts
section which can used to define shortcuts for anything you need to run while you're working on your app. There are some pre-defined scripts, like run
or test
than can be executed with simply npm start
/npm test
or you can define anything you like and then run it with npm run my-script-name
. You could try:
{
"scripts": {
"start": "npm-run-all -p build-css build-webpack"
}
}
Any NPM module referenced here "just works" (i.e. the path to the executable is resolved under the hood by NPM)
2) NPX
In newer versions of NPM (i.e. >= 5.2 or so), the "NPX" executable is provided. This has a similar effect to running commands inside an NPM script. You would run:
npx npm-run-all -p build-css build-webpack
Again, the path would be automatically resolved.
If you have an older NPM install, you can also install it separately:
npm install -g npx