43

after installing 'npm install webpack-dev-server -g' not able to start expressjs project.

I am using below script:

"scripts": {
    "start": "run-p watch dev-server",
    "watch": "webpack --config webpack.config.js --watch --mode development",
    "dev-server": "BABEL_ENV=dev nodemon --exec 'babel-node' src/server/index.js --config nodemon.json"
}
1

4 Answers 4

83

Install/add npm-run-all

npm i npm-run-all --save-dev
1
  • even better, npm i npm-run-all -D and then add run-p: npm run run-p to your package.json.scripts section Sep 16, 2022 at 4:50
5

Run

npm install npm-run-all --save-dev

So that npm-run-all package https://www.npmjs.com/package/npm-run-all is saved into package.json as dev dependency (so that other developers don't get the same problem)

Docs https://docs.npmjs.com/specifying-dependencies-and-devdependencies-in-a-package-json-file

0

Maybe you are not in the correct folder path in the terminal. Check it once and move to the correct project folder and run the desired command

0

I had npm-run-all in my package.json > "devDependencies" but still was getting the same error:

'npm-run-all' is not recognized as an internal or external command, operable program or batch file

The solution was to install it globally using the following command:

npm i npm-run-all -g

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.