使用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 ]
有大佬遇到这个问题吗?
package.json 里面没有 "scripts": {"dev": "xxx"}