Create separate directory:
mkdir server && cd server
Make server.js file with following content:
const express = require('express') const app = express() const port = 3000 app.get('/', (req, res) => { res.send('Hello World!') }) app.listen(port, () => { console.log(`Example app listening at http://localhost:${port}`) })
Then:
npm install express node server.js