运行npm run serve后出现 npm ERR! missing script: serve什么情况?
发布于 3 年前 作者 chaoren 2011 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

D:\vue-project>npm run serve

npm ERR! missing script: serve
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2019-08-31T07_12_47_303Z-debug.log

2019-08-31T07_12_47_303Z-debug.log里面的内容如下

0 info it worked if it ends with ok
1 verbose cli [ ‘D:\node.exe’,
1 verbose cli ‘D:\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘run’,
1 verbose cli ‘serve’ ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose stack Error: missing script: serve
4 verbose stack at run (D:\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack at D:\node_modules\npm\lib\run-script.js:63:5
4 verbose stack at D:\node_modules\npm\node_modules\read-package-json\read-json.js:115:5
4 verbose stack at D:\node_modules\npm\node_modules\read-package-json\read-json.js:418:5
4 verbose stack at checkBinReferences_ (D:\node_modules\npm\node_modules\read-package-json\read-json.js:373:45)
4 verbose stack at final (D:\node_modules\npm\node_modules\read-package-json\read-json.js:416:3)
4 verbose stack at then (D:\node_modules\npm\node_modules\read-package-json\read-json.js:160:5)
4 verbose stack at ReadFileContext. (D:\node_modules\npm\node_modules\read-package-json\read-json.js:332:20)
4 verbose stack at ReadFileContext.callback (D:\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
4 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:237:13)
5 verbose cwd D:\vue-project
6 verbose Windows_NT 6.1.7601
7 verbose argv “D:\node.exe” “D:\node_modules\npm\bin\npm-cli.js” “run” “serve”
8 verbose node v10.15.3
9 verbose npm v6.4.1
10 error missing script: serve
11 verbose exit [ 1, true ]

回到顶部