npx react-native init projectName
npx react-native start
npx react-native run-android
npx react-native init projectName --template react-native-template-typescript
npm start
npm run android
npx react-native init 명령어를 통해 프로젝트를 시작해도 터미널 상에서는 패키지등이 설치되는 듯 보였으나 디렉터리 안에 들어가보면 아무 파일이 없었다. 당연히 npm start 명령어도 먹히지 않았다. --template react-native-template-typescript 옵션을 추가했을 때, 파일은 생성되었으나 여전히 npm start 명령어를 인식하지 못했다. package.json의 script 부분에는 명령어가 정상적으로 등록이 되어 있었다.
이미 react-native-cli가 글로벌하게 설치되어 있기 때문에 yarn add react-native 명령어거 실패했을 수도 있다. 따라서 react-native-cli를 먼저 삭제해준다.
npm uninstall -g react-native-cli
그 다음으로는 노드 버전에 대한 에러가 떠서 노드를 업데이트 해서 해결했다.
Mac에서 React Native 개발 환경 갖추기
Homebrew
VSCode
Node.js
JAVA8 JDK
'Lecture > React Native' 카테고리의 다른 글
React Navigation (0) | 2021.08.10 |
---|---|
2021-07-31 :: Typescript 내용 정리 (0) | 2021.07.31 |
2021-07-18 :: React Native; Interaction (0) | 2021.07.18 |
2021-07-17 :: React Native; Design (0) | 2021.07.17 |
2021-07-17 :: React Native Official; The Basics (0) | 2021.07.17 |