For my $HOME/.npmrc config, I have the following config:

prefix=~/.npm-global

So when installing npm modules globally, they will be installed in a directory that’s owned by my user instead of to a system directory. This prevents write permission issues when trying to install modules not owned by my user.