강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

재훈님의 프로필 이미지
재훈

작성한 질문수

[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)

[2-0] Stack Navigation 설치 및 설정

react-native-screens 버전 호환 문제

작성

·

28

·

수정됨

0

버전 호환 문제

 

현재 강의 흐름대로 react-native 0.79.4 버전을 깔고 이 강의에서
npm install @react-navigation/native

npm install react-native-screens react-native-safe-area-context
를 그대로 실행해서 설치하면


npx pod-install ios Need to install the following packages: pod-install@1.0.9 Ok to proceed? (y) y 🔍️ Scanning for pods... 1.16.2 > pod install Found 2 modules for target mapzip2 link_native_modules! {:ios_packages=>[{:configurations=>[], :name=>"react-native-safe-area-context", :root=>"/Users/kwakori/projects/react-native/learning/mapzip2/node_modules/react-native-safe-area-context", :path=>"../node_modules/react-native-safe-area-context", :podspec_path=>"/Users/kwakori/projects/react-native/learning/mapzip2/node_modules/react-native-safe-area-context/react-native-safe-area-context.podspec", :script_phases=>[]}, {:configurations=>[], :name=>"react-native-screens", :root=>"/Users/kwakori/projects/react-native/learning/mapzip2/node_modules/react-native-screens", :path=>"../node_modules/react-native-screens", :podspec_path=>"/Users/kwakori/projects/react-native/learning/mapzip2/node_modules/react-native-screens/RNScreens.podspec", :script_phases=>[]}], :ios_project_root_path=>"/Users/kwakori/projects/react-native/learning/mapzip2/ios", :react_native_path=>"../node_modules/react-native"} Auto-linking React Native modules for target mapzip2: RNScreens and react-native-safe-area-context Framework build type is static library Configuring the target with the New Architecture [!] Invalid Podfile file: [!] /opt/homebrew/bin/node ./../node_modules/react-native/scripts/generate-codegen-artifacts.js -p /Users/kwakori/projects/react-native/learning/mapzip2/ios/.. -o /Users/kwakori/projects/react-native/learning/mapzip2/ios -t ios [Codegen] Analyzing /Users/kwakori/projects/react-native/learning/mapzip2/package.json [Codegen] Searching for codegen-enabled libraries in the app. [Codegen] The "codegenConfig" field is not defined in package.json. Assuming there is nothing to generate at the app level. [Codegen] Searching for codegen-enabled libraries in the project dependencies. [Codegen] Found react-native [Codegen] Found react-native-safe-area-context [Codegen] Found react-native-screens [Codegen] Searching for codegen-enabled libraries in react-native.config.js [Codegen] Processing FBReactNativeSpec [Codegen] Searching for podspec in the project dependencies. [Codegen] Processing rncore [Codegen] Searching for podspec in the project dependencies. [Codegen] Processing safeareacontext [Codegen] Searching for podspec in the project dependencies. [Codegen] Supported Apple platforms: ios, macos, tvos, visionos for safeareacontext [Codegen] Processing rnscreens [Codegen] Searching for podspec in the project dependencies. [Codegen] Supported Apple platforms: ios, tvos, visionos for rnscreens [Codegen] Error: Unknown prop type for "environment": "undefined" [Codegen] Done. . # from /Users/kwakori/projects/react-native/learning/mapzip2/ios/Podfile:20 # ------------------------------------------- # > use_react_native!( # :path => config[:reactNativePath], # ------------------------------------------- Couldn't install Pods. Updating the Pods project and trying again...

와 같은 에러가 발생합니다.

아무래도 버전 호환성 문제인 것 같습니다.

https://github.com/software-mansion/react-native-screens/blob/main/README.md#support-for-fabric

위 문서를 참고하면 react-native-screens의 최신 버전인 4.19.0+ 는 react-native 0.81.0+ 에서만 호환된다고 하는 것 같습니다. 강의 들으시는 분들은 참고해주세요.

버전을 낮춰서 설치하시거나 하시면 정상적으로 설치되더라구요

//

아니면 혹시 그냥 react-native를 0.81.0+ 로 설치해서 강의를 들어도 문제없으려나요?

답변 1

0

안녕하세요, 인프런 AI 인턴입니다.
재훈님, 강의에서 겪고 있는 버전 호환 문제에 대해 도움을 드리겠습니다.

현재 상황에서 두 가지 옵션이 있습니다:

  1. 리액트 네이티브와 관련된 라이브러리들의 버전 호환성을 맞추기 위해 react-native-screens의 버전을 react-native 0.79.4에 맞추어 이전 버전으로 설치하는 방법입니다. 예를 들어, npm install react-native-screens@4.18.1 같은 명령어로 버전을 명시하여 설치해 보시는 것이 좋습니다.

  2. 반대로 react-native의 버전을 0.81.0+로 올려 최신의 react-native-screens 버전을 사용할 수 있도록 하는 방법입니다. 하지만 이 경우 강의 내용과 호환되지 않을 수 있는 부분이 생길 수 있어서 이후 코딩한 내용이나 UI 변경 등을 확인하며 따라가야 할 필요가 있습니다.

강의 진행 중이라면, 첫 번째 방법(라이브러리 버전 조정)을 추천드립니다. 이미 프로젝트가 잘 진행되고 있고, 강의에 설명된 기능이 최신 버전에 충분히 적용된다면 두 번째 방법(react-native 업데이트)도 고려해보실 수 있습니다.

추가적으로 독립적인 소스 참고 링크를 확인하여 현재 사용하고 있는 라이브러리의 버전 호환 정보를 꼭 검토하길 고지드립니다.

문제가 잘 해결되시길 바랍니다. 더 궁금한 사항이 있으면 언제든지 연락 주세요.

재훈님의 프로필 이미지
재훈

작성한 질문수

질문하기