【发布时间】:2019-11-25 00:31:03
【问题描述】:
我的申请有问题。因为在我创建应用程序之前它可以工作,但是现在它向我显示了这个错误,我不知道为什么以及我必须做些什么来修复它。
你有什么想法可以帮助我吗? (这是一个 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
【问题讨论】:
-
我尝试更改环境变量,但不确定要在 PATH 中添加什么
-
1.
npm cache clean --force, 2. 删除node_modules文件夹, 3.npm install4.npm start.应该修复错误,对我有用。为了安全起见,在执行npm install之前也删除package-lock.json -
我会试试的,但是每次新建应用程序都会再次出现这个错误
-
with : npx create-react-app app-example -> cd app-example -> npm start (之前有效)
-
某事可能在同一个端口上运行,尝试更改,在 MAC 中尝试,netstat -vanp tcp | grep 3000
标签: node.js reactjs windows git-bash