Upgrade Node.js via NPM
This method of upgrading node is now unstable and should not be used. The best way to manage Node.js versions is to use NVM: Node Version Management.!
I was recently installing a utility via NPM when I learned that my version of Node.js itself was out of date. No worries -- simply upgrade my Node.js install and move forward. Of course I could just hit nodejs.org and get the new image, but figured there had to be an easier way. It turns out there is -- you can upgrade your local Node.js with NPM:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
The 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.21
Once your install is complete, you can confirm you version with another command:
It's quite nice that you can upgrade Node.js right from npm; it's like Inception...or something.
CSS cubes really showcase what CSS has become over the years, evolving from simple color and dimension directives to a language capable of creating deep, creative visuals. Add animation and you've got something really neat. Unfortunately each CSS cube tutorial I've read is a bit...
CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there's...
Just to be pedantic – ‘n’ isn’t something that the guys behind npm and nodejs core team created nor necessarily support.
‘n’ the package ‘https://github.com/visionmedia/n’ is created and maintained by the prolific TJ Holowaychuk. It’s one of many competing version managers for nodejs – https://github.com/creationix/nvm being another.
While I do sometimes need to manage different versions of node (those tools are convenient for sure) I personally rely upon a decent package manager on my OS. ‘Homebrew’ (or MacPorts/Fink if a masochist) on OSX. ‘Chocolatey’ on Windows. (Linux users probably have it in their distro’s package manger)
Installing via the provided packages will ensure that npm itself is up to date too (which not all other solutions do).