项目场景:

提示:这里简述项目相关背景:

例如:项目场景:导入Spring Boot+vue项目时,运行npm run dev报错

问题描述

提示:这里描述项目中遇到的问题:运行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了

总结

原文地址:https://blog.csdn.net/qq_47863414/article/details/125098969

相关文章:

  • 2021-04-17
  • 2021-04-08
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2021-10-16
猜你喜欢
  • 2022-01-05
  • 2021-10-15
  • 2021-10-01
  • 2021-08-19
  • 2021-11-03
  • 2022-12-23
  • 2021-07-09
相关资源
相似解决方案