Installing node.js on Windows 7

Installing node.js on Windows is really easy. Navigate to nodejs.org and just click install. You will be prompted to save installation file to disk. After saving, run the installation wizard, agree to terms and wait untill the instalation process finshes. Great, that is all to it. Now to confirm we have node installed on our machine we can open the cli (cmd) and enter:

node -v

We should see the information about the current verision of node.js In my case it is v0.8.14
In some cases it is advised to work in Linux operating system because only there we have access to commands like

make

which can compile files from sources. If you would like to know how to install node.js on Linux Ubuntu, please visit my post where I cover this topic.

Installing node.js on Linux Ubuntu

To install node.js on Linux Ubuntu we’re going to use terminal.:

sudo apt-get install nodejs

Unfortunately, installing like this will give us version 0.6.12 which is not the latest one. So if we want the most recent version we need to compile it from source.
First of all we need to grab the most recent version from nodejs.org, and there download the source code which is going to be a .tar.gz file. After saving to disk we need to unzip it. Open the terminal and from there extrect the files. I saved my file node-v0.8.14.tar.gz into /home/Downloads.
We need to switch to super user to be able to perform the following tasks.

sudo su

Next switch directory to where we need to compile node.js

cd /usr/local/src/

Copy archive to current dir…

cp /home/kummar/Downloads/node-v0.8.14.tar.gz .

…and extract it.

tar -xzf node.v0.8.14.tar.gz

Go to newly created dir (which is going to be called something like node-[ver] ie. mine was node-v0.8.14)

cd node-v0.8.14

run the configuration…

./configure

…make…

make

…and install.

make install

After successfull instalation we can log out from super user’s account.

exit

We can confirm successful instalation by checking what version is installed.

node -v

We should see something like this

node v0.8.14

Congratulations, you have got the latest and greatest version of node.js installed on your system. But wait, what is going to happen if next version comes out? Oh well…
Captain obvious to the rescue! nvm which stands for node version manager but that is a topic for another time.