In the modern age, node installation is handled by the 'n', eg,
sudo n stable #the current stable version
sudo n 0.10.40 # to install v0.10.40
Once you have installed a version, it never goes away. You can switch back and forth between versions instantly. That means that you can easily alternate between two (or more) versions if you want.
But, you might (as I did) have an app that must run on an old version but you otherwise want to use a modern version. That is, you want two different versions active at once.
This can be done by referring to the node binary with a fully qualified path. (Remember, when you type "node", your shell is simply giving you /usr/local/bin/node.)
The program 'n' allows you to find the path to the binary (assuming that you have previously installed it), ie,
n bin 0.10.40
You can then type
into your shell or put it into your initialization script or whatever.
I create separate users for each of the apps I have running on my server. There is only one that requires the old version of node. I want to use the latest stable version for everything else so, I have done "n stable". For the user account where I run the old app, I change my .bash_alias file to include...
Then I can type
and get good results, or,
But when I log in as the user for a different app, I get the latest stable version.
Obviously, you can do this for as many node versions as you want but, if you need a lot, you might want to think about why (for me, it is Meteor, which only runs on old node).
I have had occasion since I wrote this to install a new server. I was reminded that the utility 'n' does not come automatically with a NodeJS install. After you install NodeJS (which also installs npm), type
sudo npm install n -g
and the you can verify it by typing
and you will get all kinds of good info.