인프런 커뮤니티 질문&답변
환경세팅 및 버전 관련질문입니다.(react-native init 명령어 관련 등)
해결된 질문
작성
·
1.1K
0
node: nvm으로 여러 node버전을 use명령어로 바꿔가면서 프로젝트마다 버전관리를 하면서 사용할 수 있을 것 같습니다.
2. java는 17 버전을 사용합니다 (rn 0.72,0.73 버전과 함께사용할수 있다는 다른분의 질문답변을 봤습니다. )
3. react-native를 0.72버전으로 시작하고 싶어서 아래의 명령어로 실행했습니다
-react-native라이브러리 설치E:\RN_PJ>npm i -g react-native E:\RN_PJ>react-native -v 13.6.9-해당 라이브러리로 프로젝트 생성
E:\RN_PJ>npx react-native init FoodDeliveryApp --version 0.72 --template react-native-template-typescript
프로젝트 생성하는 명령어에서의 에러메세지
- 요약하면 version이랑 template이랑 함께 사용할수 없는 명령어라는 내용같습니다.⚠️ The `init` command is deprecated. The behavior will be changed on 2024. 12. 31. (131 days). - Switch to npx @react-native-community/cli init for the identical behavior. - Refer to the documentation for information about alternative tools: https://reactnative.dev/docs/getting-started Running: npx @react-native-community/cli init error Passing both "version" and "template" is not supported. The template you select determines the version of react-native used. Please use only one of these options, for example: --template react-native-template-typescript@x.y.z where x.y.z is the release of the template that contains the desired "react-native" version. Check the version tab of https://www.npmjs.com/package/react-native-template-typescript for available versions. info Run CLI with --verbose flag for more details.-chat gpt 는 아래의 명령어를 실행해보라는데 이렇게 시작해도되는지 잘 모르겠습니다. (...)
npx react-native init FoodDeliveryApp --version 0.72.0 npx react-native init FoodDeliveryApp --template react-native-template-typescript@X.Y.Z
추가 참고 사항 및 질문사항)
현재 node14, java17로 진행하고있는 프로젝트가 있어서
java를 17버전으로 진행하려고 했습니다. JAVA_HOME을 17버전으로 잡아놔서... 프로젝트 왓다갔다 할 때마다 JAVA_HOME바꾸는 방법밖에는 모르겠어서 그렇게 하고싶지는 않아가지구... os가 windows인데 nvm처럼 java버전관리 할수있는게 없는것 같습니다...
보통 실무에서 java는 버전 관리를 어떻게 하나요?
(도커같은 컨테이너로 프로젝트 별 환경관리를 하지 않을까하는 추측을 하고있습니다.) 따로 관리하는 방법이 있는지 궁금합니다.)
답변 1
0
이제 리액트 네이티브는 타입스크립트를 지원해서 그냥 version만 표기하셔도 됩니다.
저는 자바에서는 그냥 jdk를 버전별로 다운로드받아둔 뒤, 프로젝트별로 해당 버전을 가리키는 환경변수를 다르게 시팅했던 것 같습니다.






감사합니다!