Skip to content

Instantly share code, notes, and snippets.

@marcelosantos
Last active October 11, 2017 18:44
Show Gist options
  • Save marcelosantos/1928cdcdbd798baffed27b1d1efc40cd to your computer and use it in GitHub Desktop.
Save marcelosantos/1928cdcdbd798baffed27b1d1efc40cd to your computer and use it in GitHub Desktop.

Option 1: Change the permission to npm's default directory

1 - Find the path to npm's directory:

$ npm config get prefix

2 - Change the owner of npm's directories to the name of the current user (your username!):

$ sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,share}

Based on https://docs.npmjs.com/getting-started/fixing-npm-permissions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment