Node.js Components – Node.js modules, NPM install update uninstall example

Filed Under: Node.js

In my previous post, we have discussed about “How to setup Node JS Base Environment“. In this post, we will discuss about “Node JS Platform Major Components” and NPM install update uninstall example.

Node JS Platform Components

Node JS is Platform, not a Framework. It contains many components to develop, test and deploy Enterprise applications.

Node JS Components List:


Node CLI

Node JS Platform has a CLI (Command Line Interface) to run basic commands and also script files.

When we install Node JS Platform, by default we will get this component. We do not need to any extra configurations for this component.

We can observe “node.exe” file at NODSJS_HOME. It is also known as Node Platform CLI component.

How to access Node CLI:

  1. Open Command prompt at NODSJS_HOME
  2. Run “node.exe” command


    Now we are able to see NODE CLI i.e. “>”, that means our Node JS Setup is working fine.

    Here we can run basic Java Script commands one by one or entire Java Script files (*.js files) to test the basic functionality.


NPM stands for Node Package Manager. NPM is used to install, update, uninstall and configure Node JS Platform modules/packages very easily.

When we install Node JS Base Platform, it installs only few components, modules and libraries like Node CLI, NPM etc. From this point, we can use NPM to upgrade Node JS Platform with our required modules.

By default Node JS platform install NPM module. We can observe this at NODEJS_HOME\node_modules folder as shown below.


When we install any other required modules, we can observe new folders here. That means for each module or package, Node JS maintains a separate folder here.

We can observe “npm.cmd” in Windows environment at NODEJS_HOME. This command is used to run NPM component from command prompt.

NOTE: In simple words, Maven is used to build Java modules into jar files and NPM is used to create, install, install and update Node Modules.

To check npm version, run “npm -v command as shown in below image.


NPM Command Syntax

  • NPM Install to install a module


    For example, npm install –g express command is used to install Express Module.

    .tg {border-collapse:collapse;border-spacing:0;border-color:#ccc;}
    .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#ccc;color:#333;background-color:#fff;}
    .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#ccc;color:#333;background-color:#f0f0f0;}
    .tg .tg-4eph{background-color:#f9f9f9}

    Sl No.Command PartsDescription
    1.-gIt tells install this module globally that is with all administrator permissions.
    2.expressExpress module or package unique name

    We will discuss in-detail about each module installation in coming posts.

    When we install modules by using npm, it use two modes install at two difference locations.

    Local Mode: When we install Node JS Platform, by default it uses Local Mode to install npm module in node_modules directory as shown in below screen shot.


    Sample command for installing express module would be “npm install express“.

    Global Mode: When we use npm command with –g option, it uses Global Mode to install modules as shown in below screen shot for “npm install –g express” command.


    Here “express” module is installed with Global Mode.

  • NPM uninstall to uninstall or remove an existing module;


  • NPM update to update an existing module;



package.json” is plain text file in JSON format. It is used to manage our application required module dependencies. We should place this file in our application root folder.

It defines information like our application name, module dependencies, module versions etc. This configurations file is very important and requires more time to explain in detail. We will discuss it in detail with some examples in coming posts.

Sample package.json file;

  "name" : "sampleapp",
  "version" : "1.0.0",
  "dependencies" : {

Node Modules

Node JS is more modular platform. Each functionality is implemented by a separate module or package. It has some core modules like npm, install, uninstall, update etc and rest all modules are third-party modules.

When we install Node JS Platform, by default only one module is installed i.e. npm module. We need to use “npm” command to install required modules one by one.

All Core or Default modules are installed at /lib folder as *.js files as show below. In our case this path refers to “D:\NodeJS.V.0.12.0\node_modules\npm\lib”.


Node JS has thousands of modules, but here we are going to provide some of the popular modules. We will discuss and provide some examples about these modules in coming posts.


While writing this post, Node JS Platform supports the following number of packages.


A full list of Node JS Platform’s packages or modules can be found on the NPM website

Some of the Node JS Modules are written in Java Script and some are in C/C++ Language.

Development Tools and Frameworks

As Node JS Platform became very popular to develop Data-Sensitive Real-time and Network applications, many companies have developed some tools and framework to ease and reduce the overhead of Node JS applications.

IDEEclipse with node.js plugins, Jetbrains Webstorm, Cloud9 IDE,
Visual Studio Node JS Toolkit
DatabaseMongoose for MongoDB
UI Build ToolsGrunt, Yeoman, Gulp
CLINode CLI, grunt-cli
UI Library ManagementBower
UI FrameworksBackbone.js, Angular.js, Ember.js
Layout FrameworksTwitter Bootstrap Framework
Template EngineJade, EJS, Hogan.JS
CSS EngineStylus, LESS, Compass
Unit Testing FrameworksJasmin, Node Unit

We will try to use some of these frameworks and tools to develop our Node JS examples in coming posts. [no_toc]


  1. Amit B says:

    Excellent post, very easy language and to the point. Thanks

    1. Pankaj says:

      You are welcome Amit B.

  2. sankar says:

    Please provide Node.js & Angular Js, Bootstrap e-Books in a easy methodology.

Comments are closed.

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors