简体   繁体   English

初始化 react-native 项目时无法安装 cocoapods

[英]failure to install cocoapods when initializing a react-native project

I'm currently running macOS Catalina 10.15.6 and XCode 12.4.我目前正在运行 macOS Catalina 10.15.6 和 XCode 12.4。 I'm trying to create a react native ios app and I'm on the command line running "react-native init Focus" where Focus is the name of my app.我正在尝试创建一个反应原生 ios 应用程序,我在命令行上运行“react-native init Focus”,其中 Focus 是我的应用程序的名称。

When setting up the app, I get the error "(node:11768) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template"设置应用程序时,我收到错误“(node:11768) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template”

I try to run "cd./Focus/ios && pod install" which fails, and I have also tried "sudo gem install cocoapods" and "brew install cocoapods" which all fail.我尝试运行失败的“cd./Focus/ios && pod install”,并且我还尝试了失败的“sudo gem install cocoapods”和“brew install cocoapods”。

I cannot get past this setup phase of the project.我无法通过项目的这个设置阶段。

Fire below code for the setup Project.为设置项目触发以下代码。

npx react-native init ( Your Project Name)

Above code set up your project.上面的代码设置你的项目。 And then open your project in IDE which you use for business coding and follow these steps.然后在您用于业务编码的 IDE 中打开您的项目并按照以下步骤操作。

Start your react native server by hit the following code通过点击以下代码启动您的反应本机服务器

npx react-native start

For the run in iOS do the following steps对于 iOS 中的运行,请执行以下步骤

  1. cd ios cd ios
  2. pod install吊舱安装
  3. cd..光盘..
  4. npx react-native run-ios npx react-native 运行-ios

Or also you can directly run from Xcode after the third step.或者也可以在第三步之后直接从 Xcode 运行。 You do not need to hit the 4 setup您无需点击 4 设置

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法为 iOS 项目 React-Native 安装 CocoaPods 依赖项 - Failed to install CocoaPods dependencies for iOS project React-Native React-native Error: Failed to install CocoaPods dependencies for iOS project, 这是这个模板所需要的 - React-native Error : Failed to install CocoaPods dependencies for iOS project, which is required by this template React-Native:错误:无法为iOS项目安装CocoaPods依赖项,这是该模板所需要的 - React-Native: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template 错误无法为 ios 项目安装 CocoaPods 依赖项。 反应原生 - Error Failed to install CocoaPods dependencies for ios project. React Native React Native - npx react-native run-ios 在初始化项目后不起作用 - React Native - npx react-native run-ios doesn't work after initializing the project 如何使用react-native版本0.48.0将SafeAreaView安装到我的项目中? - How to install SafeAreaView to my project with react-native version 0.48.0? 如何在安装了Cocoapods的React Native上安装扩展? - How to install extensions on React Native installed with Cocoapods? 安装react-native-custom-segmented控件,需要安装ios框架才能进行react-native项目 - Installing react-native-custom-segmented control, need to install ios framework to react-native project 使用cocoapods for Firebase的React-native共享扩展问题 - Issue with React-native share extension with cocoapods for firebase react-native:在 macos mojave 上运行项目时出错 - react-native: error when run project on macos mojave
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM