Created
September 5, 2022 06:21
-
-
Save v0lkan/7c76d551c08d974d848a9a8c17190fcc to your computer and use it in GitHub Desktop.
Resolving EACCESS permissions errors when installing packages globally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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