0

I am trying to push my app to Heroku, but I am getting an error when it gets to the heroku postbuild script:

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: > [email protected] 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! [email protected] build:react-scripts build remote: npm ERR! Exit status 126 remote: npm ERR! remote: npm ERR! Failed at the [email protected] 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! [email protected] 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 [email protected] 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

Here is my package.json folder on the server side:

{
  "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"
  }
}

and on the client side:

{
  "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"
  }
}

I have tried running npm install on both the server and client side again, and have also deleted, the reinitialized the git repository. No luck. ANyone have any advice on how to get this build working?

4
  • See if this answer stackoverflow.com/questions/41932041/… helps, possibly related to dev-dependencies Commented Oct 17, 2019 at 19:36
  • On the client side I do have the react-scripts declared as a regular dependency. Based on my understanding that's what they diagnosed his issue as being. Commented Oct 17, 2019 at 19:44
  • Ok, can you try deleting /node_modules and running npm install again? Commented Oct 17, 2019 at 19:56
  • No luck - still getting that same error Commented Oct 17, 2019 at 20:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.