[英]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 中的运行,请执行以下步骤
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.