homestead执行npm run dev 报错missing script: dev
使用homestead的时候,执行npm run dev ,各种错误:
- Cannot find module node_modules/cross-env/dist/bin/cross-env.js
npm i cross-env
- peer independence 依赖报错
npm i npm-install-peers
- no such file or directory, open '/home/vagrant/package.json' 报错
npm init
- 最新的问题,执行执行npm run dev 报错:missing script: dev
npm ERR! missing script: dev
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2018-05-30T03_23_37_043Z-debug.log
vagrant@homestead:~$ cat /home/vagrant/.npm/_logs/2018-05-30T03_23_37_043Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
2 info using npm@6.1.0
3 info using node@v8.11.2
4 verbose config Skipping project config: /home/vagrant/.npmrc. (matches userconfig)
5 verbose stack Error: missing script: dev
5 verbose stack at run (/usr/lib/node_modules/npm/lib/run-script.js:151:19)
5 verbose stack at /usr/lib/node_modules/npm/lib/run-script.js:61:5
5 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:115:5
5 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:418:5
5 verbose stack at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:373:45)
5 verbose stack at final (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:416:3)
5 verbose stack at then (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:160:5)
5 verbose stack at ReadFileContext.<anonymous> (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:332:20)
5 verbose stack at ReadFileContext.callback (/usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16)
5 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:420:13)
6 verbose cwd /home/vagrant
7 verbose Linux 4.15.0-20-generic
8 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
9 verbose node v8.11.2
10 verbose npm v6.1.0
11 error missing script: dev
12 verbose exit [ 1, true ]
有大佬遇到这个问题吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
package.json 里面没有 "scripts": {"dev": "xxx"}
有的,但还是报错
还是会报错,,,重建能启动,,但是吧以前写的代码放进去就不行了