2
React Native教程01-搭建环境
source link: http://quangelab.com/React01/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
React Native教程01-搭建环境 – ruquan.z – github技术博客,成长在于积累。
React Native教程01-搭建环境
MacBook Pro (13-inch, M1, 2020)
必须安装的依赖有:Node、Watchman、Xcode 和 CocoaPods。
其中 Xcode 和 CocoaPods 如果你做过iOS开发,应该都装过,所以需要的仅仅 Node和Watchman
brew install node
brew install watchman
如果网络不好可以使用淘宝镜像
//使用nrm工具切换淘宝源
npx nrm use taobao
//如果之后需要切换回官方源可使用
npx nrm use npm
Yarn是 Facebook 提供的替代 npm 的工具,可以加速 node 模块的下载。
npm install -g yarn
创建一个名字叫AwesomeProject的项目
npx react-native init AwesomeProject
编译并运行 React Native 应用
先cd到你项目目录里面,然后执行yarn ios
cd AwesomeProject
yarn ios
当然你也可以用Xcode打开ios/AwesomeProject.xcworkspace 项目文件
Written on October 7, 2022
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK