To install express.js using npm, run the following command.

To install it globally, run the above command with -g option. g for global.

Node.js NPM install -g express

Once express.js is installed, you can import express.js into your node project using require statement.

Now, express variable holds the reference to the express.js package.

If you do not install express.js prior to using it in your Node.js project, you will get an error as below:

Node.js Cannot find module 'express'