为什么我的React应用没有在Heroku上构建?

时间:2019-12-04 18:26:54

标签: node.js reactjs heroku

我正在尝试在我的heroku上部署React应用。

这是我的package.json文件:

{
  "name": "hotel",
  "version": "1.0.1",
  "engines": {
    "node": "10.16.0",
    "yarn": "1.13.0",
    "npm": "6.9.0"
  },
  "dependencies": {
    "@glidejs/glide": "^3.3.0",
    "antd": "^3.24.2",
    "formik": "^1.5.8",
    "js-cookie": "^2.2.0",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "nprogress": "^0.2.0",
    "react": "^16.11.0",
    "react-accessible-accordion": "^3.0.0",
    "react-content-loader": "^4.2.1",
    "react-dates": "^21.1.0",
    "react-dom": "^16.11.0",
    "react-google-maps": "^9.4.5",
    "react-icons": "^3.7.0",
    "react-image-gallery": "^0.8.16",
    "react-intl": "^2.9.0",
    "react-loadable": "^5.5.0",
    "react-router": "^5.1.2",
    "react-router-dom": "^5.1.2",
    "react-scripts": "^3.2.0",
    "react-scroll": "^1.7.11",
    "react-share": "^3.0.0",
    "react-stickynode": "^2.1.1",
    "react-waypoint": "^9.0.2",
    "recompose": "^0.30.0",
    "styled-components": "^4.4.0",
    "styled-system": "^5.1.2",
    "yup": "^0.27.0"
  },
  "scripts": {
    "start": "react-app-rewired start",
    "build": "BUNDLE_VISUALIZE=1 react-app-rewired build",
    "test": "react-app-rewired test",
    "serve": "serve -s build",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],
  "devDependencies": {
    "babel-plugin-import": "^1.12.2",
    "webpack-bundle-analyzer": "^3.5.1",
    "customize-cra": "^0.8.0",
    "react-app-rewired": "^2.1.4"
  }
}

我已经在此故障排除Node.js应用程序中完成了所有操作:

https://devcenter.heroku.com/articles/troubleshooting-node-deploys#check-for-differences-between-development-and-production

当我运行comand git push heroku master

我在这里遇到此错误:

Build
remote:        Running build
remote:        
remote:        > hotel@1.0.1 build /tmp/build_4eca7ccd5f43b38306090c01a90cbfc9
remote:        > BUNDLE_VISUALIZE=1 react-app-rewired build
remote:        
remote: fs.js:114
remote:     throw err;
remote:     ^
remote: 
remote: Error: ENOENT: no such file or directory, lstat '/node_modules'

我尝试了一切。有人可以告诉我吗?

谢谢

0 个答案:

没有答案