Installing Node.JS On Windows 8

Nov 6, 2014


In short blog post I will show you how to install Node.JS on a Windows OS. For our purposes I will be using Windows 8.1 machine. The overall process should (including a test page) should not take more than 10 minutes.

Download the Node.JS installer from the Site

Download MSI

Run the Downloaded node-v0.10.33-x86.msi

Download MSI

In the installation wizard you will notice that the NPM (Node Package Manager) in not part of the Node installation package.

Download MSI

Restart the Machine

Once the installation is complete, let's try checking the version of the node by running following command in the command prompt.

node --version

Download MSI

You will get the error saying node is not recognized as valid command. And that is because the Environment variables are not set yet. You need to restart the machine. Please go ahead and do so.

After reboot, open command prompt and try running the command again and you should see the version of Node.JS you just installed.

Download MSI

Build a simple Test

To verify that Node.JS is working correctly, let's create a new test server using Node.JS. We can pick the simple server sample available at the Node.js home page

Download MSI

Create a file named TestServer.js with code from the above URL and save it a C:\Node folder. Next open the Command prompt and navigate to that folder location.

Go ahead and execute the TestServer.js using following command. node TestServer.js

It might take couple of seconds if this is the first node script you are running, but finally you should see something like below.

Download MSI

Once you get this meaning the server is running fine and you can actually navigate to this server by using the given URL. Open a browser and navigate to that URL and you should see Hello World coming back from the server.

Download MSI

That's it. You now have Node.JS setup on your Windows machine and is fully functional.