Skip to content

Instantly share code, notes, and snippets.

@chasevida
Last active August 3, 2016 13:19
Show Gist options
  • Save chasevida/84e752684cbe5b3256bc to your computer and use it in GitHub Desktop.
Save chasevida/84e752684cbe5b3256bc to your computer and use it in GitHub Desktop.
npm - EACCESS Errors

These three steps worked for me to remove the constant npm EACCESS errors I was recieving.

  1. Reclaim ownership of the .npm directory
  2. Add need write permissions for the node_modules directory
  3. Finally sort the ownership of the npm bin too

From the terminal use the following commands to achieve the above"

  1. $ sudo chown -R `whoami` ~/.npm
  2. $ sudo chown -R `whoami` /usr/local/lib/node_modules
  3. $ chown -R `whoami` `npm -g bin`

Lately, I'e run into a few additional errors that can be resolved similarly. These obviously affect the npm config and cache permissions.

  1. $ sudo chown -R `whoami` ~/.config
  2. $ sudo chown -R `whoami` ~/.cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment