React-native安装所需的CocoaPods依赖项卡住了

vic*_*xu2 18 cocoapods react-native

我无法完成本机初始化,因为该过程一直停留在安装所需的cocoapods依赖项上,请帮助

这是终端中显示的部分内容:

[4/4]   Building fresh packages...
success Saved lockfile.
success Saved 48 new dependencies.
?? @babel/core@7.5.0
?? @babel/runtime@7.5.0
?? @react-native-community/eslint-config@0.0.5
?? @types/eslint-visitor-keys@1.0.0
?? @typescript-eslint/eslint-plugin@1.11.0
?? @typescript-eslint/experimental-utils@1.11.0
?? @typescript-eslint/parser@1.11.0
?? @typescript-eslint/typescript-estree@1.11.0
?? acorn-jsx@5.0.1
?? acorn@6.2.0
?? ajv@6.10.0
?? babel-jest@24.8.0
?? chardet@0.7.0
?? doctrine@3.0.0
?? emoji-regex@7.0.3
?? eslint-scope@4.0.3
?? eslint-utils@1.3.1
?? eslint@6.0.1
?? espree@6.0.0
?? esquery@1.0.1
?? external-editor@3.0.3
?? file-entry-cache@5.0.1
?? flat-cache@2.0.1
?? flatted@2.0.1
?? functional-red-black-tree@1.0.1
?? glob-parent@3.1.0
?? ignore@4.0.6
?? import-fresh@3.1.0
?? inquirer@6.4.1
?? is-extglob@2.1.1
?? is-glob@4.0.1
?? jest@24.8.0
?? json-stable-stringify-without-jsonify@1.0.1
?? levn@0.3.0
?? lodash.unescape@4.0.1
?? metro-react-native-babel-preset@0.55.0
?? optionator@0.8.2
?? parent-module@1.0.1
?? path-dirname@1.0.2
?? progress@2.0.3
?? react-refresh@0.2.0
?? regexpp@2.0.1
?? rxjs@6.5.2
?? table@5.4.1
?? text-table@0.2.0
?? tslib@1.10.0
?? tsutils@3.14.0
?? write@1.0.3
?  Done in 19.41s.
info Installing required CocoaPods dependencies
Run Code Online (Sandbox Code Playgroud)

oto*_*oye 14

Installing required CocoaPods dependencies需要时间。等待约30分钟为我工作。

  • 嗨,我有同样的问题。这是否意味着每次我们想要创建一个react-native项目时我们真的必须等待30-40分钟???难道就没有更聪明的解决方案吗? (2认同)
  • 嗨,@preston 我后续的项目速度更快。一旦你安装了“CocoaPods”,你应该就可以了。我希望这对您有所帮助并回答您的问题。 (2认同)

小智 7

等待大约 40 分钟对我有用。安装所需的 CocoaPods 依赖项需要时间。看我的截图。在此处输入图片说明


Cha*_*ghe 6

安装 CocaPods CocoaPods 是一个用于 iOS 和 macOS 开发的包管理工具。我们使用它来将实际的 React Native 框架代码本地添加到您当前的项目中。

我们建议使用 Homebrew 安装 CocoaPods。

$ brew install cocoapods 
Run Code Online (Sandbox Code Playgroud)

或者

sudo gem install cocoapods
Run Code Online (Sandbox Code Playgroud)

  • 谢谢你,我的问题解决了。cocoapod的安装过程比较长。我等了大约1个小时就完成了。 (5认同)
  • 当我尝试时,我的终端说我已经安装了 cocoapods。 (3认同)

小智 6

修复此问题 - 打开 Xcode 并转到 Xcode \xe2\x86\x92 Preferences \xe2\x86\x92 Locations,并确保命令行工具设置为您正在使用的 Xcode 版本\xe2\x80\x99。

\n


bas*_*sil 5

用Ctrl-C中断。


输入cd ios


运行pod install --repo-update


但是无论如何它并不快。需要等待,因为大型回购已在后台克隆到fs中。

  • 建议:运行“pod install --repo-update --verbose”,这样您就可以实际看到发生了什么,并放心它没有卡住,只是非常慢。 (4认同)