推送到Heroku时构建失败

时间:2019-06-24 19:52:00

标签: reactjs heroku

尝试将应用程序推送到Heroku时出现错误。

我已经在package.json中指定了Node版本,因为这似乎是常见的问题,但是并不能解决问题。

从日志文件中:

...

       make: *** [Release/obj.target/binding/src/binding.o] Error 1

       gyp ERR! build error 

       gyp ERR! stack Error: `make` failed with exit code: 2

       gyp ERR! stack     at ChildProcess.onExit (/tmp/build_ec5990b649bb6c82e58e565ad894f600/node_modules/node-gyp/lib/build.js:258:23)

       gyp ERR! stack     at ChildProcess.emit (events.js:198:13)

       gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)

       gyp ERR! System Linux 4.4.0-1046-aws

       gyp ERR! command "/tmp/build_ec5990b649bb6c82e58e565ad894f600/.heroku/node/bin/node" "/tmp/build_ec5990b649bb6c82e58e565ad894f600/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="

       gyp ERR! cwd /tmp/build_ec5990b649bb6c82e58e565ad894f600/node_modules/node-sass

       gyp ERR! node -v v10.16.0

       gyp ERR! node-gyp -v v3.6.2

       gyp ERR! not ok 

       Build failed with error code: 1

-----> Build failed



       We're sorry this build is failing! You can troubleshoot common issues here:

       https://devcenter.heroku.com/articles/troubleshooting-node-deploys



       Some possible problems:



       - Node version not specified in package.json

         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version



       Love,

       Heroku



 !     Push rejected, failed to compile Node.js app.

 !     Push failed

Package.json文件:

{
  "name": "reaction",
  "private": true,
  "dependencies": {
    "autoprefixer": "^7.1.2",
    "axios": "^0.16.2",
    "axios-mock-adapter": "^1.9.0",
    "babel-core": "^6.25.0",
    "babel-eslint": "7.2.3",
    "babel-jest": "^20.0.3",
    "babel-loader": "7.x",
    "babel-plugin-syntax-dynamic-import": "^6.18.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-polyfill": "^6.23.0",
    "babel-preset-env": "^1.6.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-2": "^6.24.1",
    "coffee-loader": "^0.7.3",
    "coffee-script": "^1.12.7",
    "compression-webpack-plugin": "^1.0.0",
    "css-loader": "^0.28.4",
    "enzyme": "^2.9.1",
    "eslint": "3.19.0",
    "eslint-config-react-app": "^2.0.0",
    "eslint-plugin-flowtype": "2.33.0",
    "eslint-plugin-import": "2.2.0",
    "eslint-plugin-jsx-a11y": "5.0.1",
    "eslint-plugin-react": "7.0.1",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^0.11.2",
    "flush-promises": "^1.0.0",
    "glob": "^7.1.2",
    "jest": "^20.0.4",
    "js-yaml": "^3.9.1",
    "node-sass": "^4.5.3",
    "path-complete-extname": "^0.1.0",
    "postcss-loader": "^2.0.6",
    "postcss-smart-import": "^0.7.5",
    "precss": "^2.0.0",
    "prop-types": "^15.5.10",
    "rails-erb-loader": "^5.1.0",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "react-redux": "^5.0.6",
    "react-router-dom": "^4.2.2",
    "react-test-renderer": "^15.6.1",
    "redux": "^3.7.2",
    "redux-mock-store": "^1.3.0",
    "redux-thunk": "^2.2.0",
    "resolve-url-loader": "^2.1.0",
    "sass-loader": "^6.0.6",
    "style-loader": "^0.18.2",
    "webpack": "^3.5.1",
    "webpack-manifest-plugin": "^1.2.1",
    "webpack-merge": "^4.1.0"
  },
  "devDependencies": {
    "webpack-dev-server": "^2.7.1"
  },
  "scripts": {
    "test": "jest",
    "lint": "eslint app/javascript/**/* --color"
  },
  "jest": {
    "roots": [
      "./app/javascript"
    ]
  },
  "engines": {
    "node": ">= 8.0.0"
  }
}

如果您需要我发送完整的日志文件,我也可以这样做。

对于这些类型的问题,我已经检查了大多数答案,并且所有人都说要指定节点版本,并且在日志文件中也有说明,但这不能解决问题。

0 个答案:

没有答案