首先按照官网下载工具

brew install node
brew install watchman

使用nrm工具切换淘宝源
npx nrm use taobao

如果之后需要切换回官方源使用
npx nrm use npm
npm install -g yarn

下载xcode软件

下载cocoapods
sudo gem install cocoapods

初始化一个项目
npx react-native init AwesomeProject

进入项目运行项目
cd AwesomeProject
yarn ios

报错信息如下:
image.png

解决方法:
1.项目下安装pod
cd ios
pod install

2.关掉模拟器,重新启动
cd ..
yarn ios


zengna
1 声望1 粉丝

前端工程师