💭 node.js - How to fix npm throwing error without sudo - Stack O...

!https://stackoverflow.com/questions/16151018/how-to-fix-npm-throwing-error-without-sudo#answer-41395398

How to fix npm throwing error without sudo
I just installed node and npm through the package on nodejs.org, and whenever I try to search or install something with npm, it throws the following error unless I sudo the command. I have a feeling
Stack Overflow · stackoverflow.com

Its sad that this is not the accepted answer.

mkdir ~/.npm-global
export NPM_CONFIG_PREFIX=~/.npm-global
export PATH=$PATH:~/.npm-global/bin

Note

This post is a thought. It’s a short note that I make about someone else’s content online #thoughts

Connections

Related tags and posts connected to this entry.