ошибка сборки heroku "Сбой при сценарии сборки client@0.1.0" - PullRequest
0 голосов
/ 18 октября 2018

Я пытаюсь развернуть приложение реакции с сервером на heroku.Все работает на localhost, но когда я развертываю свое приложение на heroku, я получаю это сообщение об ошибке.

   > Refutation-bot@1.0.0 heroku-postbuild /tmp/build_df21544697561909eb51d857026aae6e
   > cd client && npm install --only=dev && npm install && npm run build

   up to date in 7.168s
   added 1181 packages in 29.535s

   > client@0.1.0 build /tmp/build_df21544697561909eb51d857026aae6e/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! client@0.1.0 build: `react-scripts build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the client@0.1.0 build 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!     /tmp/npmcache.on043/_logs/2018-10-17T21_17_17_261Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Refutation-bot@1.0.0 heroku-postbuild: `cd client && npm install --only=dev && npm install && npm run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the Refutation-bot@1.0.0 heroku-postbuild 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!     /tmp/npmcache.on043/_logs/2018-10-17T21_17_17_277Z-debug.log
-----> 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_modules checked into source control
     https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits

   Love,
   Heroku

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

Я считаю, что ошибка связана со скриптом сборки.Вот мой package.json в корневой папке:

{
  "name": "Refutation-bot",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node server.js",
    "test": "echo \"Error: no test specified\" && exit 1",
    "heroku-postbuild": "cd client && npm install --only=dev && npm install && npm run build"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^0.18.0",
    "dotenv": "^6.0.0",
    "express": "^4.16.4",
    "express-jwt": "^5.3.1",
    "jsonwebtoken": "^8.3.0",
    "mongoose": "^5.2.8",
    "morgan": "^1.9.1",
    "nodemon": "^1.18.4",
    "react-s-alert": "^1.4.1",
    "sh": "0.0.3",
    "sweetalert": "^2.1.0",
    "uuid": "^3.3.2"
  },
  "engines": {
    "node": "8.12.0"
  }
}

Мое приложение реакции находится внутри папки под названием client внутри моей корневой папки, как и стандарт для отправки на heroku, я считаю, поэтому не должно быть никаких проблемнасколько это касается.Кроме этого я в недоумении для слов.

...