Last Updated: December 26, 2018
·
1.483K
· fsargent

Use N for Node versions

When working in node it can be hard to keep your node versions straight. Vision Media's N was designed to fix this.
https://github.com/visionmedia/n

The name aside, N is an effective tool for building node from source and managing versions on your machine, similar to Ruby's RVM.

Now when setting up a new box, I use a recipe which performs these steps:

$ sudo apt-get install npm build-essential

$ sudo npm install -g n

$ n install stable

$ sudo apt-get remove npm

$ ln -s /usr/local/n/current/bin/npm /usr/local/bin/npm 
(this fixes a weird npm pathing issue described here: https://github.com/visionmedia/n/issues/63)

Done! You now have complete control over your node and npm version with N.