Node / React应用程序不会部署到Heroku

我的应用程序有一个React前端和一个Node后端; BE通过API服务于FE数据。 它不会部署到Heroku堆栈跟踪如下。

我试过的东西:

  1. 这个问题 。 在回答中提到的模型回购之后,我尝试了对我的package.json文件进行build模,但没有运气。
  2. 部署上面提到的模型回购 – 它工作得很好。
  3. 将模型回购部署到我自己的失败heroku应用程序 – 它运作良好,所以Heroku不是问题。
  4. 这个问题 (我已经检查了react-scripts被列为依赖项而不是dev-dependency)。

我最终可能会以模型回购为起点,逐渐复制我的项目,但希望了解可能出错的任何信息。

堆栈跟踪:

 > fsevents@1.0.17 install /tmp/build_f03b382a2b768aeb89ff9c197145d0a5/client/node_modules/fsevents > node-pre-gyp install --fallback-to-build node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.17/fse-v1.0.17-node-v48-linux-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.0.17 and node@6.10.3 (node-v48 ABI) (falling back to source compile with node-gyp) make: Entering directory '/tmp/build_f03b382a2b768aeb89ff9c197145d0a5/client/node_modules/fsevents/build' SOLINK_MODULE(target) Release/obj.target/.node COPY Release/.node make: Leaving directory '/tmp/build_f03b382a2b768aeb89ff9c197145d0a5/client/node_modules/fsevents/build' > fibers@1.0.15 install /tmp/build_f03b382a2b768aeb89ff9c197145d0a5/client/node_modules/fibers > node build.js || nodejs build.js `linux-x64-48` exists; testing Binary is fine; exiting added 1242 packages in 52.433s removed 1242 packages in 25.561s > react-ui@0.1.0 build /tmp/build_f03b382a2b768aeb89ff9c197145d0a5/client > react-scripts build sh: 1: react-scripts: not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! react-ui@0.1.0 build: `react-scripts build` npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the react-ui@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 

我的服务器package.json:

 { "name": "in-search-of-happiness", "engines": { "node": "6.10.x" }, "version": "0.0.0", "private": true, "scripts": { "start": "node ./bin/www", "heroku-postbuild": "cd client/ && npm install --only=dev && npm install && npm run build" }, "cacheDirectories": [ "node_modules", "client/node_modules" ], "dependencies": { "body-parser": "^1.17.2", "cookie-parser": "^1.4.3", "debug": "~2.6.3", "express": "~4.15.2", "jade": "^1.11.0", "mongoose": "^4.10.8", "morgan": "^1.8.2", "serve-favicon": "^2.4.3", "zombie": "^5.0.5" } } 

我的React package.json:

 { "name": "react-ui", "version": "0.1.0", "private": true, "dependencies": { "bootstrap": "^3.3.7", "fetch": "^1.1.0", "node-fetch": "^1.7.1", "process-nextick-args": "^1.0.7", "react": "^15.6.1", "react-bootstrap": "^0.31.0", "react-dom": "^15.6.1", "react-scripts": "1.0.7", "util-deprecate": "^1.0.2" }, "devDependencies": { "chai": "^4.0.2", "eslint": "^4.0.0", "sinon": "^2.3.5", "wdio-mocha-framework": "^0.5.10", "webdriverio": "^4.8.0" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" }, "proxy": "http://localhost:3001" }