javascript - 'node_modules' 不是内部或外部命令、可运行程序或批处理文件
问题描述
我在我的应用程序中使用 gulp。
- 安装一口
- 把 npm 脚本
- 使用“npm start”运行脚本
得到错误:- **> 开始
node_modules/.bin/gulp watch 'node_modules' 不是内部或外部命令、可运行程序或批处理文件。**
在 package.json 中启动脚本:- "scripts": { "start": "node_modules/.bin/gulp watch" },
请帮我解决这个问题。谢谢
解决方案
使用 npm 包时,您不需要在 node_modules 中指定可执行文件的路径。尝试以下设置:
"scripts": {
"start": "gulp watch"
},
确保 gulp 也存在于依赖项中。
"dependencies": {
"gulp": "^4.0.2"
}
推荐阅读
- javascript - YouTube Iframe API onError 事件在最近几个月没有触发
- javascript - 如何通过js或jquery将选中的项目放入输入框?
- java - spring-security-oauth2-authorization-server:0.1.1 获取令牌错误 invalid_client
- python - Python TypeError:只能将列表(不是“映射”)连接到列表
- specifications - 谁主持 ATX 规范?快速谷歌搜索表明英特尔,但我找不到下载。谁在更新标准?
- julia - 你能让 Julia 的 readdir() 函数区分文件和目录吗?
- mysql - Mysql索引使用问题
- c# - 在 c#.net 中的转发器中具有 2 个表行和数据字段的标题模板
- django - 在 django rest 框架中定义 searchFilter URL
- python - 如何使用从 Binance API 收到的数据更新谷歌电子表格