You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native 0.66.3执行pod install时无法找到ReactCommon/turbomodule/core依赖的问题求助

React Native 0.66.3执行pod install时无法找到ReactCommon/turbomodule/core依赖的问题求助

我最近在用React Native 0.66.3版本开发项目,执行pod install --repo-update命令时遇到了依赖缺失的错误,具体报错如下:

ios % pod install --repo-update
Auto-linking React Native modules for target `Mshika`: RNCAsyncStorage, RNCMaskedView, RNCPushNotificationIOS, RNDateTimePicker, RNDeviceInfo, RNGestureHandler, RNReanimated, RNSVG, RNScreens, RNSnackbar, RNVectorIcons, ReactNativeART, react-native-camera, react-native-document-picker, react-native-geolocation-service, react-native-image-picker, react-native-keep-awake, react-native-netinfo, react-native-restart, react-native-safe-area-context, and react-native-text-input-mask
Updating local specs repositories
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] Unable to find a specification for `ReactCommon/turbomodule/core (= 0.66.3)` depended upon by `React-RCTBlob`

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

我检查了本地的node_modules文件夹,确实找不到ReactCommon/turbomodule/core这个模块,有没有大佬遇到过类似的问题,求指点一下解决办法!


解决方案:

别着急,我之前也碰到过这个问题,给你几个亲测有效的解决思路:

  • 彻底清理依赖缓存后重装
    这是解决依赖不完整问题的常用操作,步骤如下:

    1. 回到项目根目录,删除node_modules文件夹:rm -rf node_modules
    2. 清除npm缓存(如果用yarn就执行yarn cache clean):npm cache clean --force
    3. 重新安装项目依赖:npm install
    4. 进入ios目录,删除Podfile.lock和Pods文件夹:rm -rf Podfile.lock Pods
    5. 最后再执行pod install --repo-update试试
  • 检查Podfile配置是否正确
    React Native 0.66版本对Podfile有特定配置要求,确保你的Podfile顶部包含这两行:

    require_relative '../node_modules/react-native/scripts/react_native_pods'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
    

    并且在target代码块内正确调用了use_react_native!方法,补充缺失的配置后重新执行pod安装。

  • 手动修复React Native包
    如果上面的方法都无效,可能是react-native包安装不完整,你可以尝试重新安装指定版本:

    npm install react-native@0.66.3 --force
    

    安装完成后去node_modules/react-native/ReactCommon目录下确认turbomodule/core是否存在,若存在再重新执行pod操作即可。


备注:内容来源于stack exchange,提问作者dice

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 13:34:34