Setup Express and run first application in Node.js

In this post we will take a step by step look in setting up Express and creating first application. I assume that you have already installed Node. If not then go ahead and install from here

Once node.js is successfully installed, you can install Express framework by running npm install express on command prompt.


After installing express, I will recommend to create a new folder and change directory to newly created folder. I have created a folder expressjs and going to create a site named mysite using express framework. To create site run command express mysite . mysite is name of the site.


On successful execution of above command you will get suggestion as below that several files has been created.


Next to install dependency. To install that navigate to site directory. You can navigate to site directory using cd mysite. In mysite directory


It will install all dependency in mysite directory.


After successful installation of dependency you should get npm info ok message as shown in above figure. Now you can run created website by express using node.


In browser navigate to server on port 3000 and you will get basic site created using express up and running.


This is how you can set up express to create sites running on node.js. In further posts we will look into routing, app.js, routing path, http verbs. I hope you like this post. Thanks for reading.

5 responses to “Setup Express and run first application in Node.js”

  1. I have Win 7 Professional and encountered with a problem on installing Express Framework, now below command solved my problem. hence giving here to help others.

    npm install -g express-generator@3

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at