Tuesday, May 24, 2011

Run multiple Node.js instances in one machine

If you want to run multiple versions of node.js in the same machine, for testing and/or dev work, try nvm. The steps to get up and running are simple.

  • git clone git://github.com/creationix/nvm.git ~/.nvm [Clones nvm from the git repo]
  • . ~/.nvm/nvm.sh [Activates nvm]
  • nvm install [ie: "nvm install v0.4.1"]

Once you have several node versions running, there are a few handy commands to keep track of them.

  • nvm ls [Lists node.js versions installed in your machine]
  • nvm use [ie: "nvm use v0.4.1"]
  • nvm deactivate [Deactivates nvm if you don't need it]

Thank you Cliff for the find :)