无法将React app部署到Heroku:项目依赖树问题

时间:2019-08-15 10:21:38

标签: reactjs heroku deployment

我无法将React应用部署到Heroku。错误(在运行heroku-postbuild脚本时)。

有错误:

There might be a problem with the project dependency tree.
remote: It is likely not a bug in Create React App, but something you need to fix locally.
remote: The react-scripts package provided by Create React App requires a dependency:
remote:   "webpack": "4.39.1"
remote: Don't try to install it manually: your package manager does it automatically.

我以前在本地计算机上遇到此错误,但已修复。现在,一切都可以在本地计算机上运行。没有问题。但是,当我尝试将应用程序部署到Heroku时,由于该错误而失败。

我现在该怎么做才能在Heroku上进行部署?

这是我的package.json

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@babel/core": "^7.5.5",
    "@babel/preset-env": "^7.5.5",
    "@babel/preset-react": "^7.0.0",
    "@khanacademy/react-multi-select": "^0.3.3",
    "axios": "^0.19.0",
    "babel-eslint": "^10.0.2",
    "babel-loader": "^8.0.6",
    "babel-plugin-add-module-exports": "^1.0.2",
    "babel-preset-es2015": "^6.24.1",
    "classnames": "^2.2.6",
    "copy-webpack-plugin": "^5.0.4",
    "eslint": "^6.1.0",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.26",
    "multiselect-dropdown-react": "^1.0.5",
    "query-string": "^6.8.1",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-dropdown-select": "^3.3.2",
    "react-intl": "^3.1.7",
    "react-moment": "^0.9.2",
    "react-redux": "^7.1.0",
    "react-router-dom": "^5.0.1",
    "react-scripts": "3.1.0",
    "react-select": "^3.0.4",
    "react-timezone": "^2.4.0",
    "redux": "^4.0.1",
    "redux-devtools-extension": "^2.13.8",
    "redux-thunk": "^2.3.0",
    "uglifyjs-webpack-plugin": "^2.2.0",
    "uuid": "^3.3.2",
    "webpack": "^4.39.1",
    "webpack-dev-server": "^3.2.1",
    "yargs": "^13.3.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "webpack_build": "WEBPACK_ENV=build webpack",
    "webpack_dev": "WEBPACK_ENV=dev webpack --progress --colors --watch"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "proxy": "http://localhost:5000",
  "devDependencies": {
    "css-loader": "^3.2.0",
    "eslint-plugin-react": "^7.14.3",
    "file-loader": "^4.2.0",
    "html-loader": "^0.5.5",
    "image-webpack-loader": "^5.0.0",
    "json-loader": "^0.5.7",
    "style-loader": "^1.0.0",
    "webpack-cli": "^3.3.6"
  }
}

0 个答案:

没有答案