惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
InfoQ
博客园_首页
美团技术团队
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
J
Java Code Geeks
T
Tailwind CSS Blog
Jina AI
Jina AI
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
爱范儿
爱范儿
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Visual Studio Blog
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

博客园 - 望穿秋水

EF表查询列表只查询其中几列的写法 Vue 设置为history模式之后,刷新页面报404错误的解决办法 前端页面部署之后刷新页面之后出现HTTP 错误 404.0 - Not Found错误问题解决 大数据开发规范 IIS中SSL证书过期更新的问题 .NET安装运行环境及IIS网站部署相关问题汇总 SSAS问题汇总 [MSSQL]开启/关闭Ad Hoc Distributed Queries组件 sqlserver安装之后,SSMS远程连接连接不上的问题解决:请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接 数据治理包括哪些方面 VUE hash路由和history路由的区别 WinForm的EXE破解(基于IL修改)【转】 C# 反编译破解软件方法【转】 TortoiseGit提交每次都需要输入账号密码的解决办法 spark mllib算法思想总结[转] MLlib算法简介 VS2019 Git连接源代码报错问题:cannot spawn askpass: No such file or directory could not read Username for ‘https://github.com‘: terminal prompts disabled 永久关闭Windows10自动更新 [转]人生就是不断试错的经历,只有见过最糟的经历,才能学会享受美好
vue项目启动报错 spawn cmd ENOENT errno
望穿秋水 · 2021-10-31 · via 博客园 - 望穿秋水

START

  • 运行vue项目(npm run dev)报错
  • 报错如下
DONE  Compiled successfully in 11178ms                                                                      下午3:42:04


  App running at:
  - Local:   http://localhost:8080/
  - Network: unavailable

  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:8080/' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! app@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app@0.1.0 serve 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:
npm ERR!     D:\node\node_cache\_logs\2020-12-19T07_42_04_693Z-debug.log

解决

  • 原因: 电脑缺少cmd运行程序的环境变量
  • 解决方法

环境变量配置图解.png

END

  • 可以总结一下啊 spawn xxx ENOENT 其实就是缺少,对应的运行程序的环境变量(系统环境变量中Path中添加C:\Windows\System32)。