설치


React-native 설치에는 2가지 방법이 있다고 하였다. 그래서 그 2가지를 모두 시도해보았으므로, 둘 다 했던 방법을 나열해보려 한다.

우선 공식 홈페이지에 보면 이렇게 하라고 굉장히 잘 나와있는 편이다.

Setting up the development environment · React Native

위의 링크를 잘 참고해서 진행하면 된다.

expo-cli

npm install -g expo-cli

글로벌하게 설치하라고 되어 있는데 나는 글로벌하게가 아니라 사실 로컬하게 설치해보고 싶었다.

어짜피 다른 폴더에서 사용할 것도 아니고, 지정된 폴더에서만 사용하기 때문에 굳이 글로벌하지 않아도 된다는 생각이라 일단 어짜피 에러 난 김에 로컬로 가보자!

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!   stack: "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/gimminji/.npm/_logs/2020-05-12T06_54_49_688Z-debug.log

글로벌하게 설치하려면 npm -g root 로 확인해서 그 루트를 찾아가 설치하면 된다.

만약에 sudo 로 설치하려고 하면 안된다는 것으로 알고 있다.