首页 > 解决方案 > 在 Heroku 中部署 React 应用程序时出现 ELIFECYCLE 错误

问题描述

我尝试使用 heroku cli 在 heroku 中部署一个反应应用程序,但出现此错误:

sh: 1: react-app-rewired: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! Test@1.7.0 start: `react-app-rewired start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the Test@1.7.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!     /app/.npm/_logs/2019-11-05T06_11_59_280Z-debug.log

其他解决方案建议删除 node_modules 和 package-lock.json 并尝试再次执行 npm install 但它似乎不起作用。我们还包括了我们正在使用的节点的版本。

这是我的 package.json

{
  "name": "Test",
  "version": "1.7.0",
  "private": true,
  "engines": {
    "node": "10.15.3"
  },
  "dependencies": {
    "@amcharts/amcharts3-react": "^3.1.0",
    "amcharts3": "^3.21.13",
    "antd": "^3.11.6",
    "antd-theme-webpack-plugin": "^1.1.6",
    "axios": "^0.18.0",
    "draftjs-to-html": "^0.8.4",
    "firebase": "5.3.1",
    "install": "^0.12.2",
    "instantsearch.css": "^7.1.0",
    "less": "2.7.3",
    "less-loader": "^4.1.0",
    "less-vars-to-js": "^1.2.1",
    "lodash": "^4.17.11",
    "moment": "^2.22.2",
    "nprogress": "^0.2.0",
    "prop-types": "^15.6.2",
    "react": "^16.8.6",
    "react-big-calendar": "^0.19.2",
    "react-bootstrap-sweetalert": "^4.4.1",
    "react-ckeditor-component": "^1.0.7",
    "react-color": "^2.14.1",
    "react-custom-scrollbars": "^4.2.1",
    "react-dnd": "^5.0.0",
    "react-dnd-html5-backend": "^5.0.1",
    "react-dom": "^16.8.6",
    "react-draft-wysiwyg": "^1.12.13",
    "react-flip-move": "^3.0.2",
    "react-google-maps": "^9.4.5",
    "react-hot-loader": "^4.6.3",
    "react-instantsearch": "^5.2.2",
    "react-instantsearch-dom": "^5.2.2",
    "react-intl": "^2.4.0",
    "react-notifications": "^1.4.3",
    "react-placeholder": "^3.0.1",
    "react-redux": "^5.0.7",
    "react-router-dom": "^4.3.1",
    "react-router-redux": "^5.0.0-alpha.9",
    "react-scripts": "^2.1.3",
    "react-simple-maps": "^0.12.1",
    "react-slick": "^0.23.1",
    "react-sortable-hoc": "^0.8.3",
    "react-star-rating-component": "^1.4.1",
    "react-stickies": "^0.0.16",
    "recharts": "^1.0.1",
    "redux": "^4.0.0",
    "redux-saga": "^0.16.0",
    "redux-thunk": "^2.3.0",
    "rheostat": "^3.0.1",
    "slick-carousel": "^1.8.1",
    "url-search-params": "^1.1.0",
    "victory": "^0.27.2"
  },
  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired --env=jsdom"
  },
  "devDependencies": {
    "add": "^2.0.6",
    "babel-plugin-import": "^1.8.0",
    "customize-cra": "^0.2.10",
    "react-app-rewired": "^2.0.2"
  },

真心希望你能帮忙。太感谢了!

标签: javascriptnode.jsreactjsheroku

解决方案


推荐阅读