【发布时间】:2020-02-17 20:36:58
【问题描述】:
我们已将我们的 react native 项目升级到带有 react (16.9.0) 的最新 react native 版本 (v0.61.2),它在 android 上运行良好。 当我们尝试在 ios 上运行它时,我们得到消息:
warning: the transform cache was reset. Loading dependency graph, done. error: bundling failed: Error: Unable to resolve module `React` from `ios/Pods/React/Libraries/react-native/react-native.js`: React could not be found within the project or in these directories: node_modules
If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules: rm -rf node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
我们已遵循升级指南,将所有依赖项更新到最新版本并更新了 pod。 我实际上不知道从哪里或如何开始调试它,因为这似乎来自 Pods 文件夹。
这是我们的 Pods 文件夹的内容:
ls ios/Pods/
Adjust GoogleDataTransport
Crashlytics GoogleDataTransportCCTSupport
DoubleConversion GoogleUtilities
Fabric Headers
Firebase Local Podspecs
FirebaseABTesting Manifest.lock
FirebaseAnalytics Pods.xcodeproj
FirebaseAnalyticsInterop Protobuf
FirebaseCore Pushwoosh
FirebaseCoreDiagnostics PushwooshInboxUI
FirebaseCoreDiagnosticsInterop React
FirebaseDynamicLinks Target Support Files
FirebaseInstanceID boost-for-react-native
FirebaseRemoteConfig glog
Folly nanopb
GoogleAppMeasurement
在我们的 node_modules 文件夹中,我们有(以及更多其他包):
...
react
depd react-deep-force-update
des.js react-devtools-core
destroy react-is
detect-libc react-lifecycles-compat
detect-newline react-native
...
当然,我已经尝试了所有步骤,例如清除缓存、重置缓存、清除 DerivedData、清理和构建…… 我不知道从哪里开始寻找。
【问题讨论】:
-
这里完全一样。
标签: ios objective-c reactjs xcode react-native