How to install express using express generator tool

In this post i am going to show you, How to install nodejs express framework using express generator tool.

This tool will automatically create express framework skeleton for your application with default templating engine jade Where we use jade for html markup.

I assume that you already have npm and nodejs installed in your system.
How to install nodeJs


Install express-generator globally using npm

$ sudo npm install express-generator -g

express-generator-1
Test express installed successfully or not using below command.

$ express -v

Now time to create your first app using express generator.

express first-app

express-generator-2

Now go to your first-app directory and run npm install

$ cd first-app
$ npm install

express-generator-3
Above command read all the dependencies form package.json file and installed in your project directory like jade templating engine module.

Your directory structure will look like somthing.
express-generator-4

Finally time to run your first express application on browser. hit below command on terminal

$ node app.js

express-generator-5

Go to your web browser and hit your localhost url with port 5000.

http://localhost:5000

express-generator-6
You can see the landing page of express framework.

Hope this tutorial will help you to setup express framework in your system.

If you like this post please don’t forget to subscribe My Public Notebook for more useful stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.