-
01. javascript 실습 환경 구성LECTURE 2024. 9. 19. 08:31
* 실습 환경 개요
: 윈도우 PC를 사용하여 WSL (ubuntu) 기반을 실행
: Docker Container 활용
* 사용 개발 툴
: WSL 설치
https://learn.microsoft.com/ko-kr/windows/wsl/install
WSL 설치
wsl --install 명령을 사용하여 Linux용 Windows 하위 시스템을 설치합니다. Ubuntu, Debian, SUSE, Kali, Fedora, Pengwin, Alpine 등 원하는 Linux 배포판에서 실행되는 Windows 머신에서 Bash 터미널을 사용할 수 있습니
learn.microsoft.com
: zsh 설치
sudo apt-get install zsh chsh -s /usr/bin/zsh // 기본 쉘 확인 echo $SHELLL
sh -C "$(Curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" // 테마설정 (필수X) vi ~/.zshrc
: VSCode
https://code.visualstudio.com/download
Download Visual Studio Code - Mac, Linux, Windows
Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.
code.visualstudio.com
: NVM 설치
sudo apt-get install curl curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
: node.js 설치nvm ls nvm install 21.7.2 node --version
: 자주쓰는 VSCODE extention 설치
Codeium CSS Peek ES7-React/Redux/React-Native snippets ESLint HTML CSS Support Live Server Material Icon Theme Night Owl PostCSS Language Support Prettier - code formatter GitLens
: Code Assist (Codieum) 설치
Codeium · Free AI Code Completion & Chat
Codeium offers best in class AI code completion, search, and chat — all for free. It supports over 70+ languages and integrates with your favorite IDEs, with lightning fast speeds and state-of-the-art suggestion quality.
codeium.com
* node.js 테스트 코드
// test.js 생성 console.log('hello world'); // > node test.js 실행 // hello world 실행 확인
* VSCode Debugger 설정
// node 설치 경로 확인 where node // 디버깅 프로파일 확인 { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "skipFiles": [ "<node_internals>/**" ], "program": "${workspaceFolder}/example01.js", "runtimeExecutable": "/home/jaykwon/.nvm/versions/node/v21.7.2/bin/node", } ] }
// debugging 예제 function calcAdd(a,b){ if (typeof a != 'number' || typeof b != 'number'){ throw new Error('Both arguments must be numbers'); } const varA = a; const VarB = b; const result = a+b; return result; } console.log(calcAdd(3,4));