reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
216 stars 327 forks source link

初始化项目出错 #659

Closed sundial-dreams closed 1 year ago

sundial-dreams commented 1 year ago

这块卡了好久了,也不知道为啥

image

`✔ Downloading template ✔ Copying template ✔ Processing template ℹ Installing dependencies ✔ CocoaPods (https://cocoapods.org/) is not installed. CocoaPods is necessary for the iOS project to run correctly. Do you want to install it? › Yes, with Homebrew ✔ Installing CocoaPods ✔ Installing Bundler ✖ Installing CocoaPods dependencies (this may take a few minutes) error warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md

✖ Installing CocoaPods dependencies (this may take a few minutes) error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.`

sunnylqm commented 1 year ago

标准翻墙问题,文档里已经特别强调过了

sundial-dreams commented 1 year ago

刚玄学的解决了,似乎不是墙的问题,代理我这边是没问题的; 解决方法:到ios目录下pod install一下,然后用npx react-native run-ios运行,就是不知道下次还能不能这么玄学

sunnylqm commented 1 year ago

因为墙的问题所以 pod install 没成功,所以需要你手动去重新pod install 如果代理没问题,那么初始化的时候就能自动 pod install 成功