React native 시작하기

김민영·2023년 1월 9일
0

React-native

목록 보기
1/1
post-thumbnail

https://ssjeong.tistory.com/entry/React-Native-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EC%83%9D%EC%84%B1-%EB%B0%8F-%EC%97%90%EB%AE%AC%EB%A0%88%EC%9D%B4%ED%84%B0-%EC%8B%A4%ED%96%89
위의 링크를 따라서 진행했습니다.

react-native init project를 했는데 오류가 발생했습니다.

found 0 vulnerabilities C:\Users\minyoung\AppData\Roaming\npm\node_modules\react-native-cli\index.js:302 cli.init(root, projectName);

cli.init이 없다는 내용이었는데, 검색해보니 옛날 버전이거나, 너무 최신버전의 오류일 수 있다고 합니다.
react-native를 모두 삭제하고 다시 설치하는 방식으로 해결했습니다.
저는 npm을 사용하고 있기에 다음을 입력했습니다. npx를 사용하면 npx로만 바꿔서 입력하면 된다고 합니다.

npm uninstall react-native-cli
npm uninstall react-native

yarn을 사용하는 경우는 다음을 사용하면 된다고 합니다.

yarn global remove react-native-cli react-native

삭제 후, 다시 설치

npm install react-native-cli
npm install react-native

프로젝트를 생성해줬습니다.

react-native init projectName

시간이 조금 지난 후 생성이 되었습니다.
RN은 프로젝트 이름입니다.

profile
노션에 1차 정리합니당 - https://cream-efraasia-f3c.notion.site/4fb02c0dc82e48358e67c61b7ce8ab36?v=

0개의 댓글