Step 1: Installing Node on Windows:

Node JS has a dedicated page for how to install node on all type of OS – Installing node on windows is pretty simple and straight forward, just head over to the node download page and download the appropriate .exe/.msi to install node.

Once installed, the node folder and related files gets added as shown below and that is all there is as far as installing “node on my machine” goes. enter image description here

Step 2: Creating my first node application:

Open up a notepad(or your favorite text editor) and create a js file with the name helloworld.js and put the below code into that file.

var http = require('http');
http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  response.end('Hello World. And then there was light.\n');
}).listen(8124, "");

console.log('Server running at');

Save the file, now its time to execute the file using node. To do that open up your command prompt and execute your file using the below mentioned command.

node helloworld.js

enter image description here

With this, your node HTTP server is up and running. (note :make sure you are running node from the same folder where the file is present.)

Browse to to check it.

enter image description here