Part 1: Node.js Basic (Installation Steps, Testing and Create a Test Project)

Published on : April 27, 2026

Author:

Category: Uncategorized


Prerequisites:

  • You should have some familiarity with JavaScript.
  • You should have some familiarity with “Windows Command Prompt”.

Node.js:

Node.js really is just a programming language: it allows you to run JavaScript code in the backend, outside a browser.
It created just using and modifying Google Chrome’s V8 Engine.
As it’s used Browser’s Engine so, your browser is a localhost (Like – wamp)
Note: Google V8 engine created using C and C++. Therefore, Node.js create almost 80% C/C++ and 20% JavaScript.

Original Author: Ryan Dahl, May 27, 2009
Developer and Sponsored: Joyent
Which Companies are using Node.js: Linkedin, Yahoo!, eBay, Twitter etc.
Purpose of using Node.js: Real time apps, mobile apps, and websites.

When we will use Node.js:

JSON APIs: Building light-weight application using JSON, where node.js really shines. Its non-blocking I/O model combined with JavaScript make it a great choice for wrapping other data sources such as databases or web.
Single page apps: If you are planning to write an AJAX heavy single page app (think gmail), node.js is a great fit as well. The ability to process many requests / seconds with low response times, as well as sharing things like validation code between the client and server make it a great choice for modern web applications that do lots of processing on the client.
Streaming data: Traditional web stacks often treat http requests and responses as atomic events. However, the truth is that they are streams, and many cool node.js applications can be built to take advantage of this fact.
Real-time Applications: Another great aspect of node.js is the ease at which you can develop soft real time systems. By that I mean stuff like twitter, chat software, sport bets or interfaces to instant messaging networks.

When we will not use Node.js:

CPU heavy apps: The most obvious such case is apps that are very heavy on CPU usage, and very light on actual I/O. So if you’re planning to write video encoding software, artificial intelligence or similar CPU hungry software, please do not use node.js.
HTML apps: While node.js will eventually be a fun tool for writing all kinds of web applications, you shouldn’t expect it to provide you with more benefits than PHP, Ruby or Python at this point. Your app might end up slightly more scalable, but no – your app will not magically get more traffic just because you write it in node.js.
Note: The truth is that while we are starting to see good frameworks for node.js, there is nothing as powerful as Rails, CakePHP on the scene yet. If most of your app is simply rendering HTML based on some database, using node.js will not provide many tangible business benefits yet.

Installing Node.js® and NPM on Windows:

NPM: NPM is a “package manager” that makes installing Node “packages” fast and easy. A package is just a code library that extends Node by adding useful features.
Note: NPM is installed when you install Node.js®
Installation Overview: Installing Node.js® and NPM is pretty straightforward using the installer package available from the Node.js web site.

Installation Steps:

Step1: Download the Windows installer from Nodejs.org.

Step2: Run the installer (the .msi file you downloaded in the previous step.)
Step3: Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).

Step 4: Restart your computer. You won’t be able to run Node.js until you restart your computer.

Test it:

By running simple commands we can make sure Node.js installed or not.
Test Node.js version:

  • Open the Windows Command Prompt
  • Type node –v.
  • You will able to see Node.js version in Node.js installed.

Test NPM version:

  • Open the Windows Command Prompt
  • Type npm –v.
  • You will able to see NPM version in NPM installed.

Create a Test Project

Create a Test File:

  • Take a simple JavaScript file
  • Name it hello.js, and just add the code console.log(‘Node is installed!’);.

To run the code simply –

  • Open your command line program
  • Navigate to the folder where you save the file and type node hello.js.
  • Just type in Windows Command Prompt node hello.js
  • You should see the output Node is installed!.

How to Update Node and NPM

New versions of Node and NPM come out frequently. To install the updates, just download the installer from the Nodejs.org site and run it again. The new version of Node.js and NPM will replace the older versions.

How to Uninstall Node and NPM:

You uninstall Node.js and NPM the same as you would most all Windows software:

  • Open the Windows Control Panel
  • Choose the Programs and Features option
  • Click the “Uninstall a program”
  • Select Node.js, and click the Uninstall link.