Why is my Node build running into a permission denied error?


When my build runs, the build fails and I run into an error that looks something like this:

ERROR in EACCES: permission denied, open '/tmp/build_xxx/node_modules/@angular/core/__ivy_ngcc__/fesm5/core.js'

This could surface as permission errors when node modules are trying to open, copy, or modify files during the build.


If you are setting npm version in package.json, make sure the version is >= 6.11.3. There was a bug with npm ci that would break the file permissions of the modules installed.

Fix: https://github.com/npm/cli/pull/243

If you don't have npm set, use the package.json to set the version to >= 6.11.3. Docs here: https://devcenter.heroku.com/articles/nodejs-support#specifying-an-npm-version

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support