Backend development with Express
  • Welcome!
  • Intro to backend development with Express
    • Tutorial
      • Getting started
      • Step 1: Setting up your project
      • Step 2: Installing Express
      • Step 3: Building the server
      • Step 4: Communicating with the server
      • Step 5: Routing
      • Step 6: Serving static files
      • Step 7: Sending your blog post to your server
      • Step 8: Extracting the blog post
      • Step 9: Saving your blog post
      • Step 10: Displaying your blog posts
      • Congratulations!
    • Extras
      • More ideas
      • Individual Blog Posts
    • Keywords
    • Command-line cheatsheet
Powered by GitBook
On this page
  1. Intro to backend development with Express
  2. Tutorial

Step 2: Installing Express

PreviousStep 1: Setting up your projectNextStep 3: Building the server

Last updated 6 years ago

Before we write any code, you'll need to install the Express library. We're going to use the to download it using the npm install command.

NPM is the place to go to download other Node code written by other people. There are thousands of open-source, 3rd-party Node modules (also known as "packages") by other people that you can download and use in your own projects.

As we install Express, we'll need to update the package.json to add Express as a dependency. We do this so that other people working on the project will know to install Express before running any of the code. This can be done by adding --save to the end of your command.

Run the following command in your terminal:

Command line
$ npm install express --save

Express should now be installed. Check your package.json file to make sure it has been added as a dependency. It will look something like this:

Node Package Manager (npm)