Notice
Recent Posts
Recent Comments
Link
«   2025/10   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

스포츠마케터의 초보 개발자 도전기

React 리액트 설치 및 실행 본문

카테고리 없음

React 리액트 설치 및 실행

teammate brothers 2024. 5. 23. 08:48

React를 설치 실행하기 위해서는 몇가지 프로그램이 필요하다.

 

<설치>

 

1.Node.js 설치

React.js를 사용하기 위새서 Node.js가 설치되어 있어야한다.

Node.js 는 아래 사이트에서 다운받아 설치한다.

https://nodejs.org/en/

 

Node.js — Run JavaScript Everywhere

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

nodejs.org

정상 성치 되었으면 cmd창에서 버전 확인이 가능하다.

2. npx 설치

npm install npx - g

 

3. React.js 설치

React.js 사용을 위해 Visual Studio Code의 CMD나 터미널에서 create-react-app도구를 사용하여 프로젝트를 생성한다.

npm install -g create-react-app

또는

npx create-react-app my-app

 

4. 작업할 폴더 생성하고 VSCode에서 작업할 폴더를 open

 

5. 폴더로 접근 후 하단 터미널 창에서 프로젝트 생성

npx create-react-app 프로젝트명

* 해당 폴더에 바로 만드려면 아래 코드로

npx create-react-app ./

 

설치완료되면 아래와 같이 프로젝트가 생성된다

 

<실행>

VSCode 터미널 창에서 npm start를 입력하면 작성한 코드가 실행된다 (아래 화면은 실행 첫 화면)