Install/update node.js in just one command!

September 26, 2012

A simple script to install/update the much frequently updated node.js platform.

Here's what you have to do to install/update node.js and npm to the version you want in just 1 command

$ curl https://raw.github.com/gist/3791075 | sh -s 0.8.10

Its a bit difficult to remember the url everytime you want to update, so you can create a simple alias function which does the job. Here's how

Put the below in your ~/.bash_profile

function update-node {
  version=$1
  curl https://raw.github.com/gist/3791075 | sh -s $version
}

Now you can simply run update-node 0.8.10 !

Oh and btw, it will install node to ~/local/node directory.


Resources: