Managing Node.JS and IO.JS with NVM
Are you building NodeJS Aps? Use NVM!
If you haven't seen NVM in action, go and install it now. I can't imagine working with Node.JS based projects without NVM. I wrote this short post, beacuse I saw a friend of mine doing some first steps in NodeJS without having NVM installed. And instead of explaining the basics on the phone I wrote a short summary, which I'd like to share with you.
Besides managing the local NodeJS installations, it also offers me the ability to easily test any app for platform upgrades. A few weeks ago I started a new NodeJS based project which I'm currently developing besides my regular work. NVM allows me to switch the current node version easily by executing
nvm use stable or
nvm use v0.12.0
nvm ls to see which versions are installed locally, when executing
nvm ls-remote you'll see a list of all available NodeJS and ioJS versions. Installing a new version is really simple.Just execute
nvm install iojs-v1.3.0 to install the most recent ioJS version on your system. Installing ioJS using NVM does not change something - for the first view.
In order to switch from NodeJS to ioJS you've to execute
nvm use iojs-v1.3.0. From this point, all your Node calls will be forwarded to the local installtion of ioJS v1.3.0.
You can see which framework you're currently running by executing
In order to uninstall a version from your system, just type
nvm uninstall iojs-v1.3.0
As you can see, it's pretty simple to get started with NVM. The biggest advantage in my eyes is that you don't loose the flexibility of changing the node engine once your environment has been setted up. And as mentioned during the introduction you can switch versions based on your projects in no time.