Before we write any code, you'll need to install the Express library. We're going to use the npm package manager to download it using the npm install
command.
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:
$ 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 like this:
Keyword | Explanation |
---|---|
npm install [package-name] |
The terminal command used to install a package from npm. |
--save |
When added to the end of an npm install command, --save adds that npm package to the package.json file. |