React-Native/Error

[React-Native][Error] /usr/local/lib/node_modules/react-native-cli/index.js:302 error

TrueSik 2022. 10. 23. 20:18

react native 프로젝트를 새로 생성할 때 발생했던 오류입니다.

 

원인

react-native 0.69.0의 새로운 버전에서 생기는 오류였습니다.

 

해결방법

react-native 0.69.0이 아닌 다른 버전으로 프로젝트를 생성하시면 됩니다.

npx react-native init projectName --version 0.68.2

위와 같은 방법으로 버전을 수정해서 실행시켜 줍니다.

 

 

참고

https://github.com/facebook/react-native/issues/34055#issuecomment-1164390603

 

TypeError: cli.init is not a function · Issue #34055 · facebook/react-native

Description npx react-native init Name throws when creating a template with RN v0.69 Version 0.69.0 Output of npx react-native info yarn v1.22.19 react-native-cli: 2.0.1 react-native: n/a - not ins...

github.com