node-pre-gyp: Permission denied in heroku push

I'm pushing my MEAN stack app to heroku but an error is arising. enter image description here

I have tried to install node-pre-gyp but the error still there. I really dont know how to fix this.


Solution 1:

Remove node_modules folder in your root folder rm -rf node_modules beacuse heroku will install all your dependencies, I hope this will work

Solution 2:

node-pre-gyp: Permission denied in heroku push::
Just ran into this error just now, researching got me here. So i tried what chris advised. Try deleting the node_modules from your repo, let Heroku install them itself, then the node-pre-gyp won't be an issue,
oh, also remember to add the engine in your package.json file

//package.json
    "engines": {
        "node": "10.16.0"
      }

so that heroku doesn't use a default version, which might not be compatible to most of your installed packages.

NB: use node --version, in your cmd to know your node version.