尝试开始反应时,为什么会出现此错误?

时间:2020-06-28 06:43:58

标签: reactjs web react-redux

我上周才在设备中安装了节点JS,其版本为12.18.1,npm版本为6.14.5。 npx create-react-app正在运行,我得到了所有节点模块和其他文件,但是当我尝试启动时,出现以下错误。 PS:我更改了文件夹,然后将其启动为npm start。

    npm start
Starting the development server...

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

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84: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! projectreact@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the projectreact@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\user\AppData\Roaming\npm-cache\_logs\2020-06-28T06_35_26_852Z-debug.log

请帮助开发人员!

1 个答案:

答案 0 :(得分:0)

您可以尝试使用命令:

lsof -i:端口号

获取端口上运行的所有进程的列表。

然后使用命令 kill -9进程ID

终止该进程