본문 바로가기

Mobile

[React-Native] expo-cli 환경 구축

node 설치

https://nodejs.org/en/blog/release/v16.20.1

v16.20.1

expo-cli 가 node v17 이상은 지원 종료됨

 

vscode 설치

expo cli 설치

npm install –g expo-cli

 

오류

121 packages are looking for funding run `npm fund` for details 29 vulnerabilities (17 moderate, 12 high) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details.

  • 해결

 

expo project 생성

expo init projectName

expo-cli 는 node 17 이상 버전에서 지원 x

 

 

프로젝트 실행

vsCode > npm start or npx expo start

 

웹 사용을 위한 라이브러리 설치

npx expo install react-native-web react-dom @expo/metro-runtime

 

포트 OPEN

8081 포트 open

 

ios : Expo, Android : Expo 앱 다운

expo.dev 회원가입

https://expo.dev/

 

Expo

Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React.

expo.dev

 

expo 로그인

server

 

expo go

 

* expo 계정 로그인 시 PC와 동기화 됨

모바일, PC 같은 네트워크 연결 및 QR 스캔

 

* 다른 네트워크를 사용하는 경우

npx expo start – tunnel

: expo 에서 ngrok 설치 확인 후 자동으로 프록시 설정해준다.