1. Node.js , VSCode설치
Node.js
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
nodejs.org
LST버전을 설치한다
https://code.visualstudio.com/
Visual Studio Code - Code Editing. Redefined
Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.
code.visualstudio.com
2. VSCode 에서 prettier설치
cmd + shfit + x 를 눌러 마켓에 들어간다
1) 한국어 팩설치
korean를 검색하여 korean Language Pack for Visual Studio Code 를 설치한다
restart해준다
2) Prettier 설치 및 세팅
prettier를 검색하여 Prettier - Code formatter 설치한다
cmd + , 를 눌러서 설정탭으로 이동
save를 검색하여
Editor: Format On Save를 체크한다
formatter를 검색하여
Ediotr: Default Formatter 를 Prettier - Code formatter 로 설정한다
3) VSCode 유용한 Extension
3. 버전확인
vscode에서
cmd + j 를 눌러서 터미널 창을 연다
노트를 설치완료하면 자동으로 npm도 설치된다
두개의 버전을 확인해보자
node -v
npm -v
4.간단한 실행
간단한 테스트를 위해 app.js를 생성하고 hello world를 찍어보자
실행은 터미널창에서 한다
먼저 저장을 한 후 아래 터미널 창에서 아래의 코드를 입력해보자
node app.js
5.nodemon 설치
nodemon : 명령어로 실시간으로 스크립트 파일을 디버깅할 수 있다
아래 터미널 창에서
npm install --global nodemon
위와 같이 설치가 완료되면
터미널 창에 nodemon app.js 를 입력하자
nodemon app.js
그러면 실시간으로 파일의 변경을 감지하여 저장을 눌러 변경될때마다 실행시켜준다
ctrl + c 를 누르면 nodemon을 exit할 수 있다
'웹 개발 > 🟩 Node.js' 카테고리의 다른 글
Express | route분리, 모듈화 (0) | 2023.06.18 |
---|---|
Express | Create Read API 개발 (0) | 2023.06.18 |
Express | express에서 미들웨어설정하기 (0) | 2023.06.13 |
Express | 데이터 모킹 (0) | 2023.06.13 |
Express | express, ts 개발 환경 셋업, helloworld출력하기 (0) | 2023.06.12 |