Javascript – “npm-run-all” Is Not Recognized As an Internal or External Command

javascriptnode.js

I installed npm-run-all and also configured the environment variable (which may or may not be not required) on my Windows machine but am getting an error:

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

I am trying to build my current project with npm run build which includes the script where the error is thrown:

npm-run-all -p build-css build-webpack

Do I have to do any additional things to make it run?

Best Answer

  1. Make sure the npm-run-all is in your package.json devDependencies.
  2. If npm-run-all is present in your package.json, run npm i
  3. If not present install it, run: npm i npm-run-all -D

If error is still present, follow these steps:

  1. Remove node_modules folder: run rm -rf node_modules
  2. Install all dependecies: run npm i

Hope this helps!