48

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

94

Install/add npm-run-all

npm i npm-run-all --save-dev 
Sign up to request clarification or add additional context in comments.

1 Comment

even better, npm i npm-run-all -D and then add run-p: npm run run-p to your package.json.scripts section
7

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

Comments

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

Comments

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 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.