visual-studio - 如何解决 npm run build command not found 错误?
问题描述
我的脚本中有这个
"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
解决方案
您可能没有npm-run-all
正确安装。
我建议确保您在本地安装它:
npm i -s npm-run-all
然后你应该可以在 npm-scripts 中使用它。
有关如何根据安装方式使用 npm 模块中的命令的更多上下文,请参阅此答案:
推荐阅读
- java - JavaFX is dissabled in Eclipse
- tensorflow - TypeError:尝试转发 NN 时,“张量”对象不可调用
- c# - dotnet 上的 Windows 应用程序绝对没有保护吗?
- c# - 开发Web方法测试工具的方法需求
- spring - 我正在使用带有 userdetailed 服务的 Spring Boot 安全性。当我通过邮递员登录时,它给出错误“状态”:404,
- javascript - document.getElementById 没有得到输入
- json - Bash:如何转义字符串以在 JSON 中使用?
- python-2.7 - Python Selenium 添加到购物车
- node.js - DiscordJS Canvas 静默失败。为什么?
- javascript - 如何在 redux 操作中获取用户 ID?