最近用idea启动VUE.js的项目报错。
找到报错的详细信息的日志文件如下:
0 info it worked if it ends with ok
1 verbose cli [ 'E:\\nodejs\\node.exe',
1 verbose cli 'E:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev',
1 verbose cli '--scripts-prepend-node-path=auto' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle bj_zxt_platform_web@1.0.0~predev: bj_zxt_platform_web@1.0.0
6 info lifecycle bj_zxt_platform_web@1.0.0~dev: bj_zxt_platform_web@1.0.0
7 verbose lifecycle bj_zxt_platform_web@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle bj_zxt_platform_web@1.0.0~dev: PATH: E:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\applicant\bj_zxt_platform_web\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;E:\git\Git\cmd;%MAVEN_HOME%\bin;E:\nodejs\;C:\Users\duyunze\AppData\Roaming\npm
9 verbose lifecycle bj_zxt_platform_web@1.0.0~dev: CWD: E:\applicant\bj_zxt_platform_web
10 silly lifecycle bj_zxt_platform_web@1.0.0~dev: Args: [ '/d /s /c',
10 silly lifecycle 'webpack-dev-server --inline --progress --config build/webpack.dev.conf.js' ]
11 silly lifecycle bj_zxt_platform_web@1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle bj_zxt_platform_web@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: bj_zxt_platform_web@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (E:\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (E:\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid bj_zxt_platform_web@1.0.0
15 verbose cwd E:\applicant\bj_zxt_platform_web
16 verbose Windows_NT 10.0.10586
17 verbose argv "E:\\nodejs\\node.exe" "E:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev" "--scripts-prepend-node-path=auto"
18 verbose node v10.16.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error bj_zxt_platform_web@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
22 error Exit status 1
23 error Failed at the bj_zxt_platform_web@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
由于不是很懂VUE的配置等各种东西。搜了一下。按照下面的方法得到了解决。具体原理不是很清楚。