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
In my case,it's because of the permission of ~/tmp.So I do:
sudo chown -R $USER ~/tmp
And it's OK!