반응형

react logo

안녕하세요. 즐거운 우리집(joyfulhome.tistory.com/) 입니다.

 

리엑트(React) 는 페이스북(FaceBook)에서 개발한 사용자 인터페이스 빌드를 위한 자바스크립트 라이브러리 입니다.

사용이 비교적 간단하고 쉬워 많은 사용이 차츰 늘어나고 있는 추세 입니다.

 

그럼 이 React를 설치하는 방법에 대해서 알아볼까요?

이 React 는 어제 말씀드린 npm, 으로 설치를 할 수 있습니다.

npm 설치를 위해서는 아래 포스팅을 확인해 주세요~ ^^

 

npm 설치 및 npm 설치 버전 확인 방법 (node.js 설치 및 버전 확인)

 

npm 설치 및 npm 설치 버전 확인 방법 (node.js 설치 및 버전 확인)

안녕하세요. 즐거운 우리집(joyfulhome.tistory.com/) 입니다. 오늘은 개발쪽 이야기를 좀 해보려고 합니다. 프로그램 등을 설치 할 때 npm 을 사용하는 경우가 있는데 이 npm 을 사용 할 수 있는지, 이 npm

joyfulhome.tistory.com

 

그럼 이 npm 으로 React (리엑트)를 설치해 볼까요?

 

 

npm 을 사용하여 react 설치

01. npm install -g create-react-app

npm 을 이용하여 instlal을 위해서 아래의 명령어를 입력해 줍니다.

명령어 > npm install -g create-react-app

 

XXXXX@MyComputer ~ % npm install -g create-react-app
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Mycomputer/.npm/_logs/2021-02-01T00_46_06_978Z-debug.log

만약 위와 같이 create-react-app 설치시  Access 오류가 발생을 한다면 이것은 권한의 문제 입니다.

(첫줄을 보시면 'checkPermissions Missing write access to /xxxxx' 라고 나오는데 해당 디렉토리에 엑세스 권한이 없다고 나오네요.)

따라서 이때는 sudo로 실행을 해주면 됩니다.

 

 

02. sudo npm install -g create-react-app (권한 오류시 sudo 실행)

super user 권한을 주기 위해 sudo 를 붙여줍니다. 

명령어 > sudo npm install -g create-react-app

 

이 때 passwor를 물어볼 수 있습니다.

그럴때는 컴퓨터 부팅 암호를 입력해 주면 됩니다.

 

 

XXXXX@MyComputer ~ % sudo npm install -g create-react-app
/usr/local/bin/create-react-app -> /usr/local/lib/node_modules/create-react-app/index.js
+ create-react-app@4.0.1
added 67 packages from 25 contributors in 1.671s

위와 같이 나오면 정상적으로 설치가 된 것입니다.

 

 

03. create-react-app 설치 버전 확인

create-react-app 의 설치 버전을 알 고 싶으면 아래와 같이 입력합니다.

명령어 > create-react-app -v

4.0.1 <- 이 부분과 같이 숫자로 나오면 정상적으로 설치가 되었고 해당 버전을 알려주는 것입니다.

 

 

그럼 정상적으로 설치를 하셨으면...

재미나게 코딩의 세계를 결험하세요~ ^^

가독성이 우수하여 쉽게 적용하실 수 있으실 것입니다.

 

그럼 오늘 하루도 즐거운 하루 되세요~ ^^

 

반응형