npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm install error: "EACCES: permission denied"

When I try to call the command npm install, I am getting this error:

Unhandled rejection Error: EACCES: permission denied, mkdir ‘/Users/danielholten/.npm/_cacache/index-v5/d0/e7’

It says this is an error with npm itself.

Anyone getting the same error or know what’s causing this error/how to fix it?


You’re probably getting hit by this bug after using ‘sudo’ to install a global package or updating npm itself following the instructions it prints.
If you’re on Linux, all you need to do is

sudo chown -R $(whoami) ~/.npm

and then repeat the command.
Should you run sudo npm install in the future, you’ll have to repeat that until above bug is fixed.