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

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. Node.js-npm-update-module-450x73
  3. Run “node.exe” command
  4. Node.js-CLI-2-450x222
  5. 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_HOMEnode_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
  • Node.js-npm-install-module-450x73
  • 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 Parts Description
    1. -g It tells install this module globally that is with all administrator permissions.
    2. express Express 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.

  • Node.js-NPM-Home-450x160

    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.

  • Node.js-npm-lib-450x343

    Here “express” module is installed with Global Mode.

  • NPM uninstall to uninstall or remove an existing module;
  • Node.js-npm-update-module-450x73
  • NPM update to update an existing module;
  • Node.js-npm-update-module-450x73


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 impor
tant 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.0node_modulesnpmlib”.


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.

NodeJS-Packages (1)

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

NodeJS-Packages (1)

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.

Category Framework/Tools
IDE Eclipse with node.js plugins, Jetbrains Webstorm, Cloud9 IDE,
Visual Studio Node JS Toolkit
Database Mongoose for MongoDB
UI Build Tools Grunt, Yeoman, Gulp
CLI Node CLI, grunt-cli
Authentication Passport.js
UI Library Management Bower
UI Frameworks Backbone.js, Angular.js, Ember.js
Layout Frameworks Twitter Bootstrap Framework
Template Engine Jade, EJS, Hogan.JS
CSS Engine Stylus, LESS, Compass
Unit Testing Frameworks Jasmin, Node Unit

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

By admin

Leave a Reply

%d bloggers like this: