Сбой приложения Nodejs с Heroku на "реакции-сценарии: отказано в разрешении" - PullRequest
0 голосов
/ 17 октября 2019

Я пытаюсь отправить свое приложение в Heroku, но получаю сообщение об ошибке, когда оно попадает в сценарий постстройки heroku:

remote: > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client remote: remote: audited 905058 packages in 15.807s remote: found 0 vulnerabilities remote: remote: remote: > client@0.1.0 build /tmp/build_b7466d5902dcde0a3dc95258046c08c6/client remote: > react-scripts build remote: remote: sh: 1: react-scripts: Permission denied remote: npm ERR! code ELIFECYCLE remote: npm ERR! errno 126 remote: npm ERR! client@0.1.0 build: build-scripts build remote: npm ERR! Exit status 126 remote: npm ERR! remote: npm ERR! Failed at the client@0.1.0 build script. remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. remote: remote: npm ERR! A complete log of this run can be found in: remote: npm ERR! /tmp/npmcache.CXg0t/_logs/2019-10-17T19_19_39_823Z-debug.log remote: npm ERR! code ELIFECYCLE remote: npm ERR! errno 126 remote: npm ERR! safety-influence@1.0.0 heroku-postbuild: NPM_CONFIG_PRODUCTION = false npm install --prefix client && npm run build --prefix client remote: npm ERR! Exit status 126 remote: npm ERR! remote: npm ERR! Failed at the safety-influence@1.0.0 heroku-postbuild script. remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. remote: remote: npm ERR! A complete log of this run can be found in: remote: npm ERR! /tmp/npmcache.CXg0t/_logs/2019-10-17T19_19_39_835Z-debug.log

Вот моя папка package.json на стороне сервера:

{
  "name": "safety-influence",
  "version": "1.0.0",
  "description": "",
  "engines": {
    "node": "12.3.1"
  },
  "main": "server.js",
  "scripts": {
    "client-install": "npm install --prefix client",
    "start": "node server.js",
    "server": "nodemon server.js",
    "client": "npm start --prefix client",
    "dev": "concurrently \"npm run server\" \"npm run client\"",
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
  },
  "author": "David Jaenike",
  "license": "ISC",
  "dependencies": {
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.19.0",
    "concurrently": "^4.1.2",
    "express": "^4.17.1",
    "gridfs-stream": "^1.1.1",
    "is-empty": "^1.2.0",
    "jsonwebtoken": "^8.5.1",
    "mongoose": "^5.7.3",
    "multer": "^1.4.2",
    "multer-gridfs-storage": "^3.3.0",
    "nodemon": "^1.19.3",
    "passport": "^0.4.0",
    "passport-jwt": "^4.0.0",
    "validator": "^11.1.0"
  },
  "devDependencies": {
    "nodemon": "^1.19.1"
  }
}

и на стороне клиента:

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "axios": "^0.19.0",
    "classnames": "^2.2.6",
    "file-saver": "^2.0.2",
    "jwt-decode": "^2.2.0",
    "moment": "^2.24.0",
    "react": "^16.10.1",
    "react-app-polyfill": "^1.0.4",
    "react-dom": "^16.10.1",
    "react-redux": "^7.1.1",
    "react-router-dom": "^5.1.2",
    "react-scripts": "^3.2.0",
    "redux": "^4.0.4",
    "redux-thunk": "^2.3.0",
    "sweetalert2": "^8.18.0",
    "sweetalert2-react-content": "^1.1.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "proxy": "http://localhost:80",
  "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"
    ]
  },
  "devDependencies": {
    "react-social-icons": "^4.1.0"
  }
}

Я попытался снова запустить npm install как на стороне сервера, так и на стороне клиента, а также удалил, повторно инициализировал репозиторий git. Не повезло. У кого-нибудь есть советы, как заставить работать эту сборку?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...