我的脚本中有这个
"scripts": {
"start": "webpack",
"compile": "tsc -p tsconfig.sequences.json",
"build": "npm-run-all -p compile start",
但是收到此错误消息
sh: npm-run-all: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! workshop4@1.0.0 build: `npm-run-all -p compile start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the workshop4@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我有6.13.4 npm版本和节点12.14
答案 0 :(得分:0)
您可能没有正确安装 npm-run-all
。
我建议确保您在本地安装它:
npm i -s npm-run-all
然后你应该可以在 npm-scripts 中使用它。
有关如何根据安装方式使用来自 npm 模块的命令的更多上下文,请参阅此答案: