๊ด€๋ฆฌ ๋ฉ”๋‰ด

ruriruriya

[React] ๋ฆฌ์•กํŠธ - ํ™˜๊ฒฝ์„ค์ •(create-react-app) ๋ณธ๋ฌธ

๐Ÿ–Œ๏ธWeb/React

[React] ๋ฆฌ์•กํŠธ - ํ™˜๊ฒฝ์„ค์ •(create-react-app)

๋ฃจ๋ฆฌ์•ผใ…‘ 2024. 4. 27. 16:00
๋ฐ˜์‘ํ˜•

React ์˜ ๊ธฐ๋ณธ ํ™˜๊ฒฝ์„ค์ •์„ ํ•ด๋ณด์ž.

1. node.js ์„ค์น˜

node.js ์‚ฌ์ดํŠธ์—์„œ ๋‹ค์šด๋กœ๋“œ LTS ๋˜๋Š” ํ˜„์žฌ๋ฒ„์ „ ํฌ๊ฒŒ ์ƒ๊ด€์€ ์—†๋‹ค.

https://nodejs.org/en/download

 

Node.js — Download Node.js®

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

nodejs.org

 

node.js ์‚ฌ์ดํŠธ์— node.js ์‚ฌ์ดํŠธ์—์„œ ๋‹ค์šด๋กœ๋“œ LTS ๋˜๋Š” ํ˜„์žฌ๋ฒ„์ „ ํฌ๊ฒŒ ์ƒ๊ด€ ์—†์Œ. ์„œ ๋‹ค์šด๋กœ๋“œ LTS ๋˜๋Š” ํ˜„์žฌ๋ฒ„์ „ ํฌ๊ฒŒ ์ƒ๊ด€ ์—†์Œ.

 

2. VS code

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

2-1. ํ”„๋กœ์ ํŠธ ํด๋” ์ƒ์„ฑ

2-2. React ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์ƒ์„ฑํ•˜๋Š” ๋ช…๋ น

.์€ ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ ์˜๋ฏธํ•จ.

npx create-react-app .

์„ธํŒ…์ด ์™„๋ฃŒ ๋˜๋ฉด ํ”„๋กœ์ ํŠธ ํด๋” ๋‚ด์— ์ž‘์—…ํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ์ด ๋งŒ๋“ค์–ด์ง„๋‹ค.

์™„๋ฃŒ๋˜๋ฉด ํ„ฐ๋ฏธ๋„์—” ๋ช…๋ น์–ด ๋“ฑ ์„ค๋ช…์ด ๋‚˜์˜จ๋‹ค.

 

2-3. ํ…Œ์ŠคํŠธ ์‹คํ–‰ํ•˜๊ธฐ

๋ฆฌ์•กํŠธ ๊ฐœ๋ฐœํ™˜๊ฒฝ์ด ์‹คํ–‰๋˜๋ฉฐ ์ฝ”๋”ฉ์„ ํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ์ด ๋™์ž‘ํ•˜๊ธฐ ์‹œ์ž‘ํ•œ๋‹ค.

npm start

์œ„์— ํฌํŠธ๋ฒˆํ˜ธ 3000๋ฒˆ์ธ localhost ์ƒ˜ํ”ŒํŽ˜์ด์ง€๊ฐ€ ์ž๋™์œผ๋กœ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์—ด๋ฆฐ๋‹ค.

๋ฐ˜์‘ํ˜•