How to install Express.js, here is the step-by-step guideline

Abu Afza
4 min readFeb 1, 2022

--

1. First you must install Node.js.

2. Then create a directory in your any drive, like E:\AfzaeLearning

3. Now open this directory in the VS code (code editor)

4. Now click into TerminalàNew Terminal from menu bar. Now the terminal will be looks like as below

5. Now write down the code PS E:\AfzaeLearning> npm init and press enter When show package name: (afzaelearning) then press enter

When show version: (1.0.0) then press enter

When show description: then press enter

When show entry point: (index.js): then press enter

When show test command: then press enter

When show git repository: then press enter

When show keywords: then press enter

When show author: then press enter

When show license: (ISC): then press enter

When show Is this OK? (yes): then write yes and press enter

If everything is ok, then shows PS E:\AfzaeLearning>

And a package.json file into the AfzaeLearning directory.

6. Now install Express. write down the code PS E:\AfzaeLearning> npm install express –save and press enter

After installing it looks like

And three files in to the AfzaeLearning directory.

7. Now install application skeleton. write down the code PS E:\AfzaeLearning> npx express-generator and press enter

destination is not empty, continue? [y/N]: y and and press enter

Finally, these files are in to the AfzaeLearning directory.

8. Now write down the code PS E:\AfzaeLearning> npm install -g and press enter

9. At last express js is installed. Now we will start express. Now write down the code PS E:\AfzaeLearning> npm start and press enter

If show error, then write down PS E:\AfzaeLearning> npm update and press enter

10. Now write down the code PS E:\AfzaeLearning> npm start and press enter then server will start

11. Write down in browser http://localhost:3000/ then the home page will show

In this way express js installed and run the server.

--

--

Abu Afza

Completed MSc in CSE. Interested in AI, ML and DL. More than 10 years in IT. I am always curious to learn something new.