Skip to content

Instantly share code, notes, and snippets.

@acidtone
Last active March 31, 2021 19:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acidtone/ef2884edd43db2182ad5a2466e7c4277 to your computer and use it in GitHub Desktop.
Save acidtone/ef2884edd43db2182ad5a2466e7c4277 to your computer and use it in GitHub Desktop.
Express: Installation

Express: Installation with npm

Prerequisites

  1. Initialized npm project with package.json file. See: Getting started with npm.
  2. You have an entry page (i.e. server.js) present in a project directory.

Instructions

  1. Navigate to your project directory using your terminal.

  2. Install express as a project dependency:

    $ npm install express

    express should now be listed in package.json and the files should be downloaded to node_modules.

  3. Import express module in your server.js file:

    const express = require('express');
  4. Create express app object:

    const app = express();

Related Gists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment