비쥬얼 스튜디오에서 진행
Ctrl + J 터미널 열기
//설치
npm init
//실행
node index.js
실행할 때마다 작성하기 어렵기 때문에 package.json > scripts > start 다음과 같이 수정
{
"name": "section03",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/index.js"
},
"author": "",
"license": "ISC",
"description": "",
"type": "module",
"dependencies": {
"randomcolor": "^0.6.2"
}
}
scripts의 start라고 정의된 명령어를 실행한다.
이때 run 생략 가능
npm run start