
(폴더 생성을 했다면 생략 가능, 바로 폴더로 들어가면 된다.)
$ mkdir 프로젝트명
$ cd 프로젝트명
$ npm init -y
$ npm install express
지금까지 잘 따라왔다면 아래 사진과 같은 구조를 가지게된다.

이제부터 간단한 테스트를 해보겠다.
const express = require("express");
const app = express();
const port = 3000;
app.get("/first", (req, res) => {
res.send("hi");
});
app.listen(port, () => {
console.log(`http://localhost:${port}`);
});
"scripts": {
"start": "node app.js"
}
npm run start 명령어로 node app.js를 실행할 수 있다.package.json에 스크립트를 설정하지 않으면 에러가 발생한다.
성공!