Before installing Express.js, make sure Node.js (LTS) and npm are installed on your machine. Every Express project starts by initializing a package.json file and installing the express package.
Step-by-Step Setup
- Create a new project directory and move into it.
- Run
npm init -yto generatepackage.json. - Install Express with
npm install express.
This adds express to your dependencies and creates a node_modules folder.
ADVERTISEMENT