Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

Node.js in 3 commands

 

A few short years ago when I started to explore Node.js, I remember the installation on my MacBook Pro required downloading the source, compiling and installing it, and then updating paths. And then you had to install NPM.

Since then, Node’s installation has been come tremendously easy and NPM is even bundled with Node. And yet, installing Node (and keeping up w/its rapid release schedule) is even easier with a nifty tool: Node Version Manager.

With Node Version Manager (or nvm) you can be up and running with Node in 3 easy commands.

Step 1: Download and install nvm.

downloading nvm1
curl https://raw.github.com/creationix/nvm/master/install.sh | sh

Step 2: Reload your shell.

reloading .bash_profile1
source .bash_profile

Step 2.5: Obtain a list of available node versions to install.

listing available node versions1
nvm ls-remote

Step 3: Install your desired version of node.

installing node version 0.10.01
nvm install v0.10.0

After that’s done, execute a node -v to verify. Now wasn’t that easy? You bet!