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 c
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/
osx homebrew