Library-Framework/React

[React] 리액트 개발 환경 설치하기 (Window)

그랴 2022. 2. 24. 18:06

1. Node.js 설치하기

 

우선, https://github.com/coreybutler/nvm-windows/releases 에 접속하여 설치 파일(nvm-setup.zip)을 실행한다.

설치 후, Windows PowerShell을 관리자 권한으로 열어준다. 이래야 에러(exit status 1: �׼����� �źεǾ����ϴ�.)를 피할 수 있다.

'관리자로 실행' 클릭하기

설치한 Node.js를 사용할 수 있게 하는 명령어를 입력해준 후, 버전 확인.


2. yarn & create-react-app 설치하기 (윈도우 사용자)

 

scoop을 설치해야 한다.. 아래 링크를 참고해서 설치하면 됩니당.

 

scoop 설치하기 (윈도우 명령어 설치 프로그램)

http://scoop.sh/ 아래의 설치 방법은 윈도우 10 기준이다. PowerShell 창 실행에서 실행이야 한다. Win...

blog.naver.com

설치가 끝났으면, scoop을 통해 yarn을 설치해주면 된다.

리액트 앱을 생성하려고 할 때 아래와 같이 에러가 발생한다.

PS C:\WINDOWS\system32> yarn create react-app tutorial
yarn create v1.22.17
[1/4] Resolving packages...
warning create-react-app > tar-pack > tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
[2/4] Fetching packages...
error fs-extra@10.0.1: The engine "node" is incompatible with this module. Expected version ">=12". Got "10.10.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

문제 1.  tar 버전 업그레이드 필요함

   > npm install tar@latest -g 

문제 2. The engine "node" is incompatible with this module.

   > nvm install latest 

   > nvm use (해당 버전) 

우는 중..... 드디어 됐다.... 내가 꼭 .... 맥북 사고 만다.......

이제 > cd (앱 이름) 을 이용해서 앱을 구동하면 아래와 같은 화면을 확인할 수 있다.