- Initialized
npm
project withpackage.json
file. See: Getting started withnpm
. - You have an entry page (i.e.
server.js
) present in a project directory.
-
Navigate to your project directory using your terminal.
-
Install
express
as a project dependency:$ npm install express
express
should now be listed inpackage.json
and the files should be downloaded tonode_modules
. -
Import
express
module in yourserver.js
file:const express = require('express');
-
Create
express
app object:const app = express();