当我在 React Native 项目的 iOS 文件夹中运行 `pod install` 时,收到与 React-utils 相关的错误

问题描述 投票:0回答:1

我正在将 React Native 版本从 0.62.2 升级到 0.72.10。

当我尝试运行 iOS 文件夹内的

pod install
时。我收到此错误
[!] Unable to find a specification for 'React-utils' depended upon by 'React-Core'\

npx react-native 信息的输出

System:
  OS: macOS 14.3
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 26.32 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 16.0.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 7.10.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2023.12.04.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/gsantos/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11255304
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 3.0.6
    path: /Users/gsantos/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.10
    wanted: 0.72.10
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

堆栈跟踪或日志

RNFBAnalytics: Using Firebase/AnalyticsWithoutAdIdSupport pod in place of default Firebase/Analytics
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Auto-linking React Native modules for target `<app-name>`: RNAppleAuthentication, RNCMaskedView, RNCPushNotificationIOS, RNDateTimePicker, RNExitApp, RNFBAnalytics, RNFBApp, RNFS, RNFastImage, RNFileViewer, RNGestureHandler, RNImageCropPicker, RNKeychain, RNPermissions, RNReanimated, RNScreens, RNSentry, RNSoundPlayer, ReactNativeExceptionHandler, intercom-react-native, react-native-background-timer, react-native-config, react-native-document-picker, react-native-fbsdk-next, react-native-image-picker, react-native-netinfo, react-native-pager-view, react-native-pspdfkit, react-native-render-html, react-native-safe-area-context, react-native-simple-toast, react-native-track-player, react-native-udp, react-native-video, react-native-webview, and rn-fetch-blob
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
RNFBAnalytics: Using Firebase/AnalyticsWithoutAdIdSupport pod in place of default Firebase/Analytics
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
/Users/gsantos/Projects/<project_name>/node_modules/react-native-fbsdk-next/react-native-fbsdk-next.podspec:4: warning: already initialized constant Pod::FBSDKVersion
/Users/gsantos/Projects/<project_name>/node_modules/react-native-fbsdk-next/react-native-fbsdk-next.podspec:4: warning: previous definition of FBSDKVersion was here
[!] Unable to find a specification for `React-utils` depended upon by `React-Core`

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

截图和视频

我已经将cocoapods版本升级到最新版本(1.15.2),并将ruby升级到3.0.6。 我已经尝试使用

--repo-update
标志运行 pod install,正如错误标签上提到的那样。

我的意思是,我希望命令成功运行:p

react-native cocoapods
1个回答
0
投票

请注意,有一个重大更改:

Bump version of Node used to 18 (f75b92a by @leotm), and minimum Node JS version to 16 (afc91de79a by @robhogan)

请参阅他们发布的发行说明的this部分:

如果您使用 nvm 管理 Mac 上的节点环境,则可以使用

nvm list
列出不同的已安装版本。如果您需要安装新版本,可以使用
nvm install vx.x.x.x
命令进行安装,并使用
nvm use vx.x.x.x
命令将终端切换为使用该更新版本。

这可能是也可能不是您面临的问题,但这是我在对项目依赖项进行重大升级时时不时遇到的问题。

© www.soinside.com 2019 - 2024. All rights reserved.