解决过程就是,我的watchman 没安装好,于是卸载,重新安装
brew uninstall watchman
brew link pcre (这个我一直提示错误,但是我忽略不管了)
brew install --HEAD watchman

修改hosts, hosts文件位置:/etc/hosts。
将下面的三个ip地址添加上
199.232.96.133 raw.githubusercontent.com
199.232.96.133 gist.githubusercontent.com
199.232.96.133 cloud.githubusercontent.com
在这里插入图片描述

  • 安装wathman的时候,提示curl: (92) HTTP/2 stream 1 was not closed cleanly before end of the underlying stream

解决方案:curl: (92) HTTP/2 stream 1 was not closed cleanly before end of the underlying stream

在命令行中输入一下的代码:
git config --global http.version HTTP/1.1
git config --global http.postBuffer 524288000

  1. Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierT... 错误

解决方案:Requested but did not find extension point with identifierxxx

在命令行中执行如下的代码:
sudo xcode-select -s /Library/Developer/CommandLineTools
如提示找不到文件,则执行安装命令:
xcode-select --install

  1. Could not get the simulator list from Xcode.xocde找不到模拟器,具体错误如下:
 Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues.
Error: Command failed: xcrun simctl list --json devices
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH

    at checkExecSyncError (node:child_process:885:11)
    at Object.execFileSync (node:child_process:921:15)
    at runOnSimulator (/Users/mac/Desktop/Learn/LearnReactive/AwesomeProject/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:167:54)
    at Object.runIOS [as func] (/Users/mac/Desktop/Learn/LearnReactive/AwesomeProject/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:121:12)
    at Command.handleAction (/Users/mac/Desktop/Learn/LearnReactive/AwesomeProject/node_modules/@react-native-community/cli/build/index.js:192:23)
    at Command.listener (/Users/mac/Desktop/Learn/LearnReactive/AwesomeProject/node_modules/commander/index.js:315:8)
    at Command.emit (node:events:513:28)
    at Command.parseArgs (/Users/mac/Desktop/Learn/LearnReactive/AwesomeProject/node_modules/commander/index.js:651:12)
    at Command.parse (/Users/mac/Desktop/Learn/LearnReactive/AwesomeProject/node_modules/commander/index.js:474:21)

解决方案:

打开Xcode。然后Preferences->在标签中选择Components。
然后在列表中安装任何一个(或多个)可用的模拟器。最好是最近的一位。
它解决了这个问题。
在这里插入图片描述

  • 用RN命令行npx react-native init AwesomeProject创建项目时,一直提示创建失败:
    解决方案:

用指定的版本创建,如下:
npx react-native init AwesomeProject --version 0.68.2
其中 “AwesomeProjec”是项目名

  • 问题:用yarn react-native run-ios运行时,提示No simulator available with name "iPhone 13".
    解决方案:

用下面的代码替换上面的命令:
yarn react-native run-ios --simulator="iPhone 14"
参考文档:error Could not find “iPhone X” simulator. Run CLI with --verbose flag for more details

  • 问题:Can‘t find “node“ binary to build React Native bundle
    解决方案:

参考文档:Can‘t find “node“ binary to build React Native bundle

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐