【问题标题】:React Js can't Run using npm startReact Js 无法使用 npm start 运行
【发布时间】:2020-02-15 09:15:14
【问题描述】:

我想运行我的项目,但是 npm start 出错 -_-

npm ERR! errno 1
npm ERR! breednder-project@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the breednder-project@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!     /home/aziz/.npm/_logs/2020-02-15T09_11_32_000Z-debug.log```

【问题讨论】:

标签: reactjs npm


【解决方案1】:

您是否尝试过恢复您的依赖项? 运行npm install

并确保至少来自 Node 和 npm 版本 npm 6 以上,node 10 以上

npm -v 
node -v

最后,尝试删除 node_modules 和 package-lock 然后再npm i

【讨论】:

  • 使用“sudo npm start”运行项目,我的linux上的问题是权限
【解决方案2】:

我之前遇到过这个问题,所以我将分享我的问题:

在 package.json 中只是验证你启动命令的完整性。也可以试试npm run start(添加运行)

"scripts": {
  "start": "react-scripts start",
  "build": "react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject"
},

【讨论】:

    【解决方案3】:

    您的项目缺少必要的依赖项来支持您的 package.json 下的“start”:“react-scripts start”子句。要修复此错误,只需删除您的 node_modules 文件夹并再次运行 npm install。

    【讨论】:

      猜你喜欢
      • 2020-06-23
      • 1970-01-01
      • 2020-09-23
      • 2021-01-25
      • 1970-01-01
      • 2016-05-02
      • 2017-09-15
      • 2019-11-28
      • 1970-01-01
      相关资源
      最近更新 更多