However, unlike other web based, server side languages (for e.g. PHP, ASP etc.), in order to run NodeJS you need to execute commands on the Windows command prompt.
So before getting started with NodeJS, make sure that you know a thing or two about the Windows command line. However, to keep your learning spirits high and not let you bogged down, I’d also say that getting along with command prompt is not a big deal at all. It’s easy and simple. Though there are tons of different commands dealing with every aspect of an operating system but to run NodeJS even just few commands will get you very far.
Now, sparing the technical details of what happens under the hood of NodeJs, let’s cut to the chase.
How to Install NodeJS on Windows 8
To install NodeJs on Windows 8 you will first have to download it.
The above link will take you to the NodeJS’s official website from where you can download by clicking the respective link.
One thing to be careful about is that you select the correct Windows bit (either 32-bit or 64-bit) when clicking on the download link.
There are different ways of determining if your windows 8 is 32-bit or 64-bit. These are:
1. From My Computer Icon
My Computer icon is normally present at the desktop of every windows. Right click the icon and click the “Properties” option to know your windows bits.
If for some reasons, the icon is not present on the desktop, you can open up windows explorer and then find the my computer icon over there. Once found, you can right click it and select the Properties option to figure out your windows.
2. Windows Command Prompt
You can also check your windows bits from the command prompt.
From the start menu click the search icon and type cmd in it. This will open up the command prompt.
Type systeminfo in the command prompt window and hit Enter.
Command prompt will display all your system information. You need to search for the line which says System Type. This will tell you either you have 64-bits or 32-bits windows installed.
Note that for 32-bit windows, you will see X86 based PC instead of X32.
Once you have figured out the right bits of your windows go to the NodeJS website and then search for your respective version of windows.
Since I’m writing this tutorial on 64-bits Windows 8 version, I will download the NodeJS version compatible with this version of windows.
You may see that there are two file formats for windows. .msi and .zip. .msi stands for Microsoft Installer. It’s a file which upon clicking, will start installing the NodeJs.
However, .zip file contains the compressed versions of the file and in order to open (or extract) the files within it, you have to first install any compression software like Winzip or Winrar.
We will go ahead with the .msi version and Once download it in our computer by clicking the 64-Bit link.
Once the download is complete, open the installer and follow the simple instructions.
Make sure you keep track of the directory where you install NodeJS. This will be our root directory. When running NodeJS programs, you have to provide full path (root diretory) of where the program is saved in the command line.
Additionally, also make sure that you install the necessary packages by selecting options in this window.
Complete the setup and NodeJS will be installed on your computer. Nice and simple. Right?
How to confirm if NodeJs is properly installed?
First, create a file, hello.js and write a simple program:
Save the file in the root directory as a JS file.
Go to the command prompt and then type “node” followed by the complete path and then name of your file with its extension.
In my case, it is node
wamp\www\node\hello.js. So I will type,
Hit “Enter” and you should see
Hello World written in the command prompt. This means that you have successfully installed and run the first program of NodeJS and it is running perfectly well.
That’s it. I hope this small tutorial will help you in your first steps towards learning NodeJS. In case you get stuck somewhere in this tutorial, just leave a message in the comments section.
I will make sure to follow up.
Once you install NodeJS on windows 8 machines, Do read this next tutorial about handling form data using GET and POST methods using NodeJS Express framework.