nu_s

[REACT] 작업 환경 설정하기 본문

REACT

[REACT] 작업 환경 설정하기

woochii 2023. 9. 12. 17:19
728x90
반응형

작업 환경 준비에 앞서

homebrew로 node.js 와 yarn을 설치해준다.

# node 설치
brew install node

# yarn 설치
brew install yarn --ignore -dependencies

 

 

잘 설치 되었는지 버전은 무엇인지 확인해준다.

# node 버전 확인
node -v

# yarn 버전 확인
yarn -v

 

다음으로 Visual Studio Code 다운로드 사이트에서 설치한 후 실행한다.

https://code.visualstudio.com/?wt.mc_id=vscom_downloads

 

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

 

create-react-app으로 프로젝트 생성

create-react-app은 리액트 프로젝트를 생성할 때 필요한 설정 과정을 생략하고 바로 간편하게 작업환경을 구축해 주는 도구이다.

 

vs code 하단에 있는 터미널에서 다음 명령어를 실행

# 프로젝트명은 hello-react로 하였다.
yarn create react-app hello-react

이렇게 hello-react란 파일이 만들어진 것을 볼 수 있다.

 

터미널에서 hello-react로 이동한뒤 실행해보자

# hello-react로 이동
cd hello-react

# 실행
yarn start

잘 실행된 것을 볼 수 있다.

728x90
반응형