How To Install Node.js Framework with Express and modules

How To Install Node.js Framework with Express and modules

1. Get a repository or package  of node.js using following command

sudo apt-get install nodejs

2. After that we need a  NodeJS package manager (npm)

sudo apt-get install npm

Run the node.js using the command

node node.js

node.js supports different modules

Examples : ,express,http..etc

var socket = require( ‘’ );
var express = require( ‘express’ );
var http = require( ‘http’ );

Install the above modules following the tutorials given below

Cannot find module ‘’

sudo npm config set registry

sudo npm install -g

Cannot find module ‘express’

sudo npm install express

Sometime they ask to get new version of node.js

Steps to get the newest version of node.js:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs -y # newer nodejs package includes npm

And then try again to install Express module

sudo  npm install express

You almost finished the installation of node.js, Run and use it.

Enter into the particular folder where node js placed.

smarttips@smart-System-Product-Name: cd /var/www/nodechat/

smarttips@smart-System-Product-Name:/var/www/nodechat $ node node.js

Then you will get a message you are connected.

Enjoy Happy coding!!!!!!!


Leave a Reply