Vue项目在VSCode中启动问题


在VSCode中使用npm run serve 报这个错误。
在cmd中进入项目目录启动,可以成功启动项目

没遇到过这种奇怪的问题

都关了,再启动一般试试

看下npm的日志,一般日志里边会有详细的报错说明

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli ‘C:\node\node.exe’,
1 verbose cli ‘C:\node\node_global\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘run’,
1 verbose cli ‘serve’
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.16.3
4 verbose run-script [ ‘preserve’, ‘serve’, ‘postserve’ ]
5 info lifecycle muqblog-vue@0.1.0~preserve: muqblog-vue@0.1.0
6 info lifecycle muqblog-vue@0.1.0~serve: muqblog-vue@0.1.0
7 verbose lifecycle muqblog-vue@0.1.0~serve: unsafe-perm in lifecycle true
8 verbose lifecycle muqblog-vue@0.1.0~serve: PATH: C:\node\node_global\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\Users\wsq\workplace\muqBlog-vue\node_modules.bin;
9 verbose lifecycle muqblog-vue@0.1.0~serve: CWD: E:\Users\wsq\workplace\muqBlog-vue
10 silly lifecycle muqblog-vue@0.1.0~serve: Args: [ ‘/d /s /c’, ‘vue-cli-service serve’ ]
11 silly lifecycle muqblog-vue@0.1.0~serve: Returned: code: 1 signal: null
12 info lifecycle muqblog-vue@0.1.0~serve: Failed to exec serve script
13 verbose stack Error: muqblog-vue@0.1.0 serve: vue-cli-service serve
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\node\node_global\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess. (C:\node\node_global\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid muqblog-vue@0.1.0
15 verbose cwd E:\Users\wsq\workplace\muqBlog-vue
16 verbose Windows_NT 10.0.17763
17 verbose argv “C:\node\node.exe” “C:\node\node_global\node_modules\npm\bin\npm-cli.js” “run” “serve”
18 verbose node v12.16.3
19 verbose npm v6.14.5
20 error code ELIFECYCLE
21 error errno 1
22 error muqblog-vue@0.1.0 serve: vue-cli-service serve
22 error Exit status 1
23 error Failed at the muqblog-vue@0.1.0 serve script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]