sudo npm cache clean -f sudo npm install -g n sudo n stableThe n package represents a Node helper, and running the last command upgrades node to the latest stable version. Instead of using “stable”, you could specify a desired version:
sudo n 0.8.21Once your install is complete, you can confirm you version with another command:
node -vIt’s quite nice that you can upgrade Node.js right from npm; it’s like Inception…or something.


