I had the same issue upgrade from Node.JS 0.4 to 0.8. What worked for me:
The OSX package installer Node.JS mistakenly does not remove the old installation with the number 0.4 n / min in / usr / bin, which then conflicts with the new 0.8 in / usr / local / bin. He just overwrites everything that is already there. I destroyed the old one by deleting it, but to make sure, I decided that a clean installation would be better:
curl https://npmjs.org/install.sh | sudo clean=yes sh
There was one last problem: after installation, although which npm correctly returns /usr/local/bin/npm , bash tried to execute from / usr / bin. This is because in OSX, bash hashes an executable name. Hashing keeps re-searching all directories in your PATH every time you run shared programs. A hash -r on the command line took care of this problem.
source share