- Initialized
npmproject withpackage.jsonfile. 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
expressas a project dependency:$ npm install express
expressshould now be listed inpackage.jsonand the files should be downloaded tonode_modules. -
Import
expressmodule in yourserver.jsfile:const express = require('express');
-
Create
expressapp object:const app = express();