React Native 环境配置 遇到的问题记录

解决过程就是,我的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

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值