Let's say you want to install forever globally:
sudo npm install -g forever
The problem here is, if you do not have a ~/.npm (npm's cache folder) and you sudo it, the cache folder will get root:root permissions. So the next non sudo install will fail with:
npm ERR! Error: EACCES
This happens because by default (on linux at least), sudo does not set $HOME (i.e. impersonates) to the target user (which is root by default).
To "fix" that you should use the -H option.
sudo -H npm install -g forever
ps: Most people won't ever notice this problem because if ~/.npm already exists npm won't overwrite its permission.
ps2: If you must use forever under sudo, use it with -H
sudo -H forever list