๐Ÿ‘จ‍๐Ÿ’ป kimtongting
article thumbnail

์ด ํฌ์ŠคํŒ…์€ Windows ์œ ์ €๋ฅผ ๋Œ€์ƒ์œผ๋กœ ํฌ์ŠคํŒ… ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

๋ฌด์ž‘์ • ๋”ฐ๋ผํ•˜๊ธฐ React ํŽธ.

 

๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค ๋•Œ๋Š” Node.js์™€ npm์„ ๋ฐ˜๋“œ์‹œ ๋จผ์ € ์„ค์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

Node.js ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

Node.js ๋งํฌ : nodejs.org/ko/

 

Node.js

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

nodejs.org

 

๋ณธ์ธ์—๊ฒŒ ๋งž๋Š” ๋ฒ„์ „์„ ์„ค์น˜ํ•˜์„ธ์š” : )

์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด, ํ„ฐ๋ฏธ๋„ ์ฐฝ์„ ์—ด๊ณ , ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ์ œ๋Œ€๋กœ ์„ค์น˜ํ–ˆ๋Š”์ง€ ํ™•์ธํ•ด๋ด…๋‹ˆ๋‹ค.

$ node -v

 

๊ทธ ํ›„, yarn์„ ์„ค์น˜ํ•ด์ค€๋‹ค. ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€ ์„ค์น˜๋งํฌ

https://classic.yarnpkg.com/en/docs/install/#windows-stable 

 

Yarn

Fast, reliable, and secure dependency management.

classic.yarnpkg.com

โ€ป๋งŒ์•ฝ ์ด๋ ‡๊ฒŒ๋„ ๋˜์ง€ ์•Š๋Š”๋‹ค๋ฉด? ์•„๋ž˜์™€ ๊ฐ™๋‹ค๋ฉด

์ปค๋งจ๋“œ ์ฐฝ์—์„œ npm install -g yarn ์„ ์ด์šฉํ•ด ๊ธ€๋กœ๋ฒŒ ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•˜์ž.

 

 

๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•ด, create-react-app ๋„๊ตฌ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

yarn global add create-react-app

์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด, create-react-app 'ํ”„๋กœ์ ํŠธ๋ช…' ์ปค๋งจ๋“œ๋ฅผ ์ด์šฉํ•˜์—ฌ, ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ๋ฅผ ๋“ค์–ด 'hello-react' ๋ฅผ ์ƒ์„ฑํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

create-react-app hello-react

๋งŒ์•ฝ, 'create-react-app'์€(๋Š”) ๋‚ด๋ถ€ ๋˜๋Š” ์™ธ๋ถ€ ๋ช…๋ น, ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ํ”„๋กœ๊ทธ๋žจ, ๋˜๋Š” ๋ฐฐ์น˜ ํŒŒ์ผ์ด ์•„๋‹™๋‹ˆ๋‹ค.

๋ผ๊ณ  ๋‚˜์˜ค๋Š” ๊ฒฝ์šฐ, ์•„๋ž˜ ๋ช…๋ น์–ด npm์„ ์ด์šฉํ•˜์—ฌ ์„ค์น˜ ํ›„, ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•˜์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

npm install -g create-react-app

npm ์„ ์ด์šฉํ•˜์—ฌ ์„ค์น˜ํ•œ ๋ชจ์Šต
ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ์ด ์™„๋ฃŒ๋œ ๋ชจ์Šต

@ํ”„๋กœ์ ํŠธ ๊ฐœ๋ฐœ ์„œ๋ฒ„ ์‹คํ–‰

์œ„ ์Šคํฌ๋ฆฐ์ƒท์„ ๋ณด์‹œ๋ฉด ํ”„๋กœ์ ํŠธ๊ฐ€ ์ƒ์„ฑ๋˜์—ˆ๊ณ , ํ•ด๋‹น ํ”„๋กœ์ ํŠธ ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•˜์—ฌ yarn start๋ฅผ ํ•˜๋ผ๊ณ  ๋‚˜์˜ค๋„ค์š”.

์—ฌ๊ธฐ๊นŒ์ง€ ์ง„ํ–‰์„ ์™„๋ฃŒํ–ˆ๋‹ค๋ฉด ๊ธฐ๋ณธ ์›น ๋ธŒ๋ผ์šฐ์ €๋กœ http://localhost:3000/ ํŽ˜์ด์ง€๊ฐ€ ์ž๋™์œผ๋กœ ๋œฐ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ด๋ ‡๊ฒŒ ๋ฆฌ์•กํŠธ ์ดˆ๊ธฐ ์„ค์ •์ด ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

-์™„๋ฃŒ. 

 

IntelliJ์—์„œ ํ”„๋กœ์ ํŠธ๋ฅผ Importํ•˜์—ฌ Open ํ•œ ๋ชจ์Šต.

 

 

 

๋ฐ˜์‘ํ˜•
profile

๐Ÿ‘จ‍๐Ÿ’ป kimtongting

@kimtongting ์ž…๋‹ˆ๋‹ค

ํฌ์ŠคํŒ…์ด ์ข‹์•˜๋‹ค๋ฉด "์ข‹์•„์š”โค๏ธ" ๋˜๋Š” "๊ตฌ๋…๐Ÿ‘๐Ÿป" ํ•ด์ฃผ์„ธ์š”!