On Mac OS X, when installing with Homebrew's brew install npm
, the installation path is /usr/local/share/npm/
with both bin/
and lib/node_modules/
subfolders.
Running this command to change to owner to your currently logged in user should fix it all up, and allow you to install global NPM packages without sudo
.
sudo chown -R $USER ~/.npm /usr/local/share/npm/