运行npm run dev报错
码小小 人气:0项目场景:
提示:这里简述项目相关背景:
例如:项目场景:导入Spring Boot+vue项目时,运行npm run dev报错
问题描述
提示:这里描述项目中遇到的问题:运行npm run dev报错,在网上试了好多方法,都没解决。
原因分析:
提示:这里填写问题的分析:
Note that the development build is not optimized.
To create a production build, run npm run build.
events.js:292
throw er; // Unhandled ‘error’ event
^Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted ‘error’ event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -4058,
code: ‘ENOENT’,
syscall: ‘spawn cmd’,
path: ‘cmd’,
spawnargs: [ ‘/c’, ‘start’, ‘“”’, ‘/b’, ‘http://localhost:9528/’ ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! flash-vue-admin@4.1.0 dev:vue-cli-service serve --open
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the flash-vue-admin@4.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
02T04_57_12_486Z-debug.log
解决方案:
提示:这里填写该问题的具体解决方案:
报错的主要问题是:错误:-4058,
代码:“ENOENT”,
系统调用:’ spawn cmd ',
路径:“cmd”,
在环境变量Path中添加 C:\Windows\System32
1.右键此电脑-- 属性 – 高级系统设置 – 高级 – 环境变量 – 系统变量,找到Path,双击新建路径。
2.重启项目就OK了
总结
加载全部内容