Skip to content

Instantly share code, notes, and snippets.

@bnb
Created July 17, 2020 20:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnb/be64cc93a40dbc9486c727f42560b6b3 to your computer and use it in GitHub Desktop.
Save bnb/be64cc93a40dbc9486c727f42560b6b3 to your computer and use it in GitHub Desktop.

bad practice

sudo npm i -g <module>

good practice

npm config set prefix <directory>
npm i -g <module>

an example

npm config set prefix global_modules # npm will create this directory if it doesn't already exist
npm i -g standard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment