【问题标题】:Why am I getting this error when I try to start react?当我尝试开始响应时,为什么会出现此错误?
【发布时间】:2020-10-18 11:53:01
【问题描述】:

我上周才在我的设备上安装了 node 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

请帮助开发者!!

【问题讨论】:

  • 是的,我已经检查过了,并且已经尝试了其中的每一个 ::: npm cache clear --force ,将 C:\Windows\System32 添加到 PATH 中,在我的设备中重新安装节点 JS在这里发布之前。但似乎没有一个工作。我不断收到错误!!!

标签: reactjs web react-redux


【解决方案1】:

您可以尝试使用命令:

lsof -i : 端口号

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

然后使用命令kill -9 Process Id

杀死进程

【讨论】:

    猜你喜欢
    • 2021-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-14
    • 1970-01-01
    相关资源
    最近更新 更多