Skip to content

Instantly share code, notes, and snippets.

@v0lkan
Created September 5, 2022 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v0lkan/7c76d551c08d974d848a9a8c17190fcc to your computer and use it in GitHub Desktop.
Save v0lkan/7c76d551c08d974d848a9a8c17190fcc to your computer and use it in GitHub Desktop.
Resolving EACCESS permissions errors when installing packages globally
# ref: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
# Update ~/.profile with this:
export PATH=~/.npm-global/bin:$PATH
# Then source it to use the new $PATH:
source ~/.profile
# Now, you can `npm install -g` without needing `sudo`:
npm install -g pm2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment