首页 > 解决方案 > npm start 问题(错误:spawn cmd ENOENT)

问题描述

我的申请有问题。因为在我创建应用程序之前它可以工作,但是现在,它向我显示了这个错误,我不知道为什么以及我必须做些什么来修复它。

你有什么想法可以帮助我吗?(这是一个 reactJS 应用程序)。

我检查了一些 stackoverflow 主题,但在我检查的所有地方,这并不是一个真正有效的答案。

events.js:180
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:3000/' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fix-react-module@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fix-react-module@0.1.0 start 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!     C:\Users\Lucas\AppData\Roaming\npm-cache\_logs\2019-07-16T09_33_39_111Z-debug.log

标签: node.jsreactjswindowsgit-bash

解决方案


C:\Windows\System32添加到全局 PATH 环境变量中。


推荐阅读