今天在执行 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
后来找到这篇文章 , 问题就解决了 .
链接 : https://www.jb51.net/article/265260.htm
解决方法 :
方法一 :
在环境变量Path中添加 C:\Windows\System32
1.右键此电脑-- 属性 – 高级系统设置 – 高级 – 环境变量 – 系统变量,找到Path,双击新建路径。
2.重启项目就OK了
如果不是以上问题 ,可以看一下,下面的文章
方法二 :
https://blog.csdn.net/qq_45369827/article/details/115648040
方法三
还有一种说法是版本的问题,换个版本试一下 .