在代码签出后首次启动服务器时,我的react js项目抛出错误“ events.js:187 throw er; //未处理的’error’事件”。我有节点12.13.0和npm 6.12.0。日志文件附加日志文件
events.js:187 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:80: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:80:21) { errno: 'ENOENT', code: 'ENOENT', syscall: 'spawn cmd', path: 'cmd', spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:3000/' ] }
我将react-script版本从3.0.1降级到2.1.8。npm install react-scripts@2.1.8 npm install npm开始