How to install Node JS in windows

[Social9_Share type="horizontal"]

1. Getting started with Node JS

The intention to start this Node JS tutorial series is that I want to share what I have learnt and am learning in Node. This will surely be helpful for beginners as I am trying to put the concepts in easy English rather than using technical jargon words Note: You must know basic JavaScript to learn Node JS Now let’s get started with Node JS

  1. What is Node JS?
  2. How Node Works?
  3. Download and install Node
  4. The Node REPL

1. What is Node JS?

Node JS is a server-side JavaScript platform which is used to build fast, scalable network applications. Node JS runs on Chrome’s V8 JavaScript engine and makes it faster.

Node uses an event-driven non-blocking I/O model that makes it efficient for developing Data Intensive Real Time (DIRT) applications.
To know how node works, let us learn about event driven programming

Event Driven Programming

In event driven programming the flow of execution is driven by events. Events are handled by Event Handlers or Callbacks. When an event occurs(user clicks a button, text field losing or gaining focus), the functions that are invoked are called as Callback functions.

Callback Functions are passed as parameters into other functions. They are called and get executed inside these functions

In JQuery, you write

Here the function within the click method is a callback function. This function will be executed, only when the button is clicked.
Assume in a web application, you want to process a request and generate a response after running a database query. Let us see the scenario in case of blocking IO and non-blocking IO.

Blocking I/O

An Example for blocking IO

In this example, the thread or the process waits, till the backend database work is completed and returns back with the output(result). Then with this output, doWork method will be called. This is called as Blocking I/O as the thread waits, till the work is done.

Non-Blocking I/O

An Example for Non-Blocking IO

Here, you are using a method processDBRequest which takes 2 parameters. The first parameter is the query to the database and the second parameter is a callback function.

Here, the thread will not wait for the outcome, but will continue with the flow of the program, and prints “Hello World”. Once the database work is done and returns back with the result, then the callback function will be invoked. Now, the method doWork() will be called. This makes the whole procedure asynchronous.

You might be having multiple similar methods, all running in parallel. Their callback methods will be invoked accordingly, once the method completes the IO operation and returns with the result. This is a feature of Node JS.

2. How Node Works?

Node uses event driven, non-blocking I/O programming model. The JS Engine runs the request and then tells what to do when the response returns. In the meantime, your code is free to start processing other incoming requests or do any other task it might need.

In this type of programming, current process will not block when it is doing I/O. So, several operations can run in parallel and the corresponding callback function will be invoked when the operation finishes.

Event Loop

Event Loop is a construct in event-driven programming style. It performs two operations in a continuous loop – detecting an event and triggering an event handler. Node’ s event loop will keep on spinning whenever an event occurs , then identifies the event callback and invokes it.

3. Installation of Node JS in windows

To install Node JS on a windows machine, go to . Choose the Windows Installer(.msi)for 32 bits or 64 bits depending on your machine and download it.

download node

Once downloaded double click the msi Installer. A new window opens.


Click Next and proceed. Select Node JS runtime and click next. click Install button to install Node JS in your computer. Once completed click the Finish button to complete the installation and exit the setup wizard.


Verify the Installation

To check whether node is installed, open command prompt(cmd). Type node --version
You must get the version of Node JS installed.


If you get the output as,‘node’ is not recognised as internal or external command, then Node JS is not added to the path. Add Node installation path to the environment variables

4. The Node REPL

Next, in the command prompt type node, to launch the Node Shell. This is also called as REPL(Read-Eval-Print- Loop). This is an easy way to check node. You can execute JavaScript and see the results immediately. Let’s see an example.


Type console.log('Let us learn Node ');. You will get the output as below


The first line is the outcome of the statement you have written. Here ‘console’ is the global variable of Node and log is a function to print the output to the command line. The next line prints the return type of the statement.

Every function call or statement or expression has a value associated with it , that is printed in REPL. If the function or expression does not return any value, then ‘undefined’ is printed in the console(which we got now). Few more examples


To view all the commands of REPL use .help.It will list out all the commands of REPL


While writing in REPL , if you see three dots(…) , it means the REPL is still expecting more input from you to complete the expression, statement or function.


To exit the REPL press Ctrl+D once or Ctrl+c twice or use .exit


Once done, move on to the next session, to learn how to create a webserver using node js..
Happy Learning.


  1. Reply
    CSPS Protocol says

    What a Nice and informative blog. Thanks for sharing.

Post a comment