【发布时间】:2020-01-26 19:23:49
【问题描述】:
我已经安装了 npm create-react-app,当我尝试使用 npm start 作为试用时出现以下错误(如下所示)。我是初学者,我试图删除我的节点模块 package.json 和 package-lock.jason 并重新安装它们。我更新了所有当前的依赖项并进行了 npm 审计修复,但错误仍然存在。任何建议将不胜感激。
节点版本 12.14.1 创建反应应用程序版本 3.3.0 视窗 10
events.js:200
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:81:21)
Emitted 'error' event on ChildProcess instance 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:81:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app@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\pandh\AppData\Roaming\npm-cache\_logs\2020-01-22T10_07_03_047Z-debug.log
【问题讨论】:
-
您在本地机器上运行的是什么版本的 Node.js? (使用
node -v查找)。您可以在终端上添加您执行的所有步骤吗? -
我使用的是 v12.14.1。我只是做了一个 npm start 并收到错误。我尝试检查以确保所有软件包都是最新的并清除了我的缓存,但错误仍然存在。