【问题标题】:ELIFECYCLE error encountered when attempting to start React app using "npm start"尝试使用“npm start”启动 React 应用程序时遇到 ELIFECYCLE 错误
【发布时间】:2020-09-15 15:32:04
【问题描述】:

我在尝试启动我的 React 应用程序时遇到以下错误。

 events.js:174
     throw er; // Unhandled 'error' event
     ^ Error: spawn powershell.exe ENOENT
     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
     at onErrorNT (internal/child_process.js:415:16)
     at process._tickCallback (internal/process/next_tick.js:63:19) Emitted 'error' event at:
     at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
     at onErrorNT (internal/child_process.js:415:16)
     at process._tickCallback (internal/process/next_tick.js:63:19) 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!    
 /root/.npm/_logs/2020-09-15T14_43_41_420Z-debug.log

我在 Windows 10 系统上的 VSCODE 中使用 bash 终端。

可能相关的其他信息:

  • 用于安装 create-react-app 的命令 --> npm install create-react-app
  • 用于创建新反应应用程序的命令 --> npx create-react-app my_app
  • NPM 版本 --> 6.14.4

请注意,我是 React 的初学者。非常感谢您对此提供的任何意见。谢谢!

【问题讨论】:

    标签: reactjs npm npx


    【解决方案1】:

    你能提供更多信息吗?你在用yarn start吗?

    另外附注 - 如果使用 npx,您不必安装 create-react-app。这个答案解释了npxnpm - https://stackoverflow.com/questions/50605219/difference-between-npx-and-npm#:~:text=npx%20is%20a%20npm%20package,it%20in%20a%20single%20step 之间的区别。

    【讨论】:

    • 不,我正在使用 npm start。是的,我用过 npx。好的,我去看看,谢谢!
    猜你喜欢
    • 2020-12-02
    • 1970-01-01
    • 1970-01-01
    • 2018-02-07
    • 1970-01-01
    • 2023-03-07
    • 2020-07-03
    • 2017-12-09
    • 1970-01-01
    相关资源
    最近更新 更多