How to install express js

Deepak Tailor Image
Deepak Tailor - Nov 22 2021
How to install express js

Create a directory for your project and then create package.json file in it.

npm init –y
How to install express js

open this project in (VS Code) Code editor.

Then install express framework

npm install express

To use the development server, install nodemon.

npm install nodemon –D

To code in React style, install the ESM package.

npm install esm

We can check whatever package we have installed from the package.json file.

How to install express js

Create a file for the server server.js

// import express framework
import express from 'express';

// call express function
const app = express();

// call listen function for server
app.listen(3000, () => {
    console.log('node js server started on 3000 port');
});

Go to package.json file and set command for development server.

    "dev" : "nodemon -r esm server.js"
How to install express js

Your development server start successfully.

Deepak Tailor Image
Deepak Tailor

My name is Deepak tailor as a fullstack developer. I have been in the IT industry (PHP, Nodejs, flutter) for the last 5 years. For professional and customize web development & app development, you can send inquiry on our email.
----
You can contact him at deepaktailor10@yahoo.in