

Npm ERR! error rolling back Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this: $ npm update npm -g If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together.

NEVER run npm as sudo so never do sudo npm install. You should now be able to run the npm command without sudo. # if you reach this step, w/o any errors => ALL OK!

The bin/npm symlinks should now work # make sure it works, and update to latest available npm: Mv package /usr/local/npm_packages/lib/node_modules/npm # move the extracted `package` in the correct place and rename to `npm` Rm -rf /usr/local/npm_packages/lib/node_modules/npm # remove the broken npm symlink (generated by the nppmjs install.sh script) # manually download and un-targz into a local dir (it will be named `package`)
