第一步:把完整的node_modules文件夹复制到项目目录中去;
第二部:在Profile中加入:(注意下面的path跟你项目文件夹中node_modules路径一致)
pod 'React', :path => './node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTActionSheet',
'RCTGeolocation',
'RCTImage',
'RCTNetwork',
'RCTPushNotification',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'RCTAnimation',
'RCTBlob',
'RCTLinkingIOS',
]
pod'yoga', :path => './node_modules/react-native/ReactCommon/yoga'
# 如果RN版本 >= 0.45则加入下面三个第三方编译依赖
pod'DoubleConversion', :podspec => './node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod'glog', :podspec => './node_modules/react-native/third-party-podspecs/glog.podspec'
pod'Folly', :podspec => './node_modules/react-native/third-party-podspecs/Folly.podspec'
第三步:执行 pod install (如果提示路径找不到,请检查上面的path跟你项目文件夹中node_modules路径一致)
第四步:编译Project (如果node_modules完整,编译应该是OK的)