RN学习之路1:mac系统下搭建RN环境
1,安装homebrew
终端输入 ruby -e "$(curl --insecure -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果遇到报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 13 ms: Connection refused
请输入 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2,安装RN的依赖
brew install node
brew install watchman
//需要依赖python报错:Error: python@3.10: the bottle needs the Apple Command Line Tools to be installed.
解决:官网下载安装:
(1)下载python的地址:https://www.python.org/downloads/
(2)安装完毕后终端输入python3,如下图所示即安装成功
brew install flow
3,安装React Native
npm install -g react-native-cli
4,创建RN项目
react-native init HelloRN
报错 Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./HelloRN/ios && pod install".
解决:按照提示操作即可
有可能需要更新cocoapods版本
sudo gem install cocoapods
网友评论