我在 Windows 计算机上安装了 npm-run-all 并配置了环境变量(可能需要也可能不需要),但出现错误:
'npm-run-all' is not recognized as an internal or external command, operable program or batch file
我正在尝试使用 npm run build
构建当前项目,其中包含引发错误的脚本:
npm-run-all -p build-css build-webpack
我需要做任何额外的事情才能让它运行吗?
最佳答案
- 确保
npm-run-all
位于您的 package.jsondevDependencies
中。 - 如果 package.json 中存在
npm-run-all
,请运行npm i
- 如果不存在,请安装它,运行:
npm i npm-run-all -D
如果错误仍然存在,请按照下列步骤操作:
- 删除node_modules文件夹:运行
rm -rf node_modules
- 安装所有依赖项:运行
npm i
希望这有帮助!
关于javascript - "npm-run-all"未被识别为内部或外部命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54525742/