I get this error if I run
curl http://npmjs.org/install.sh | sh
even with sudo.
cirk@cirk-Parallels-Virtual-Platform:~$ cu
I screwed up the permissions on my npm installation, and had this error when reinstalling. I solved it in the crudest way: by liberally sudo rm -rf
ing any directory tree that gave me trouble, then recompiling node.js and reinstalling npm.
If all else fails, you could fall back to that.
Why are you running that in /usr
?
If you really need to, this page suggests you may run that as root, so that would be:
curl https://www.npmjs.com/install.sh | sudo sh
But you better make sure it won't break your system, before running that.