iOS原生项目(Objective-C)集成React Native(0.57.3版本)图文教程--(1)基本环境
文章目录
iOS原生项目(Objective-C)集成React Native(0.57.3版本)图文教程–(1)基本环境
RN官网: 搭建开发环境
https://reactnative.cn/docs/0.51/getting-started/RN官网: iOS原生应用集成RN
https://reactnative.cn/docs/0.51/integration-with-existing-apps/
****博客: iOS原生项目集成RN0.56版本
https://blog.****.net/liu__000/article/details/81030881iOS原生混合RN开发详解
https://www.cnblogs.com/guangqiang/p/9595710.html
1. Homebrew
Homebrew
: Mac 系统的包管理器,用于安装 NodeJS
和一些其他必需的工具软件
2. Node
Node
: React Native
目前需要 NodeJS 8.0
或更高版本
#安装
brew install node
#查看版本号
node -v
#更新node
brew upgrade node
安装完 node
后建议设置 npm
镜像以加速后面的过程
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
3. Yarn
Yarn: Yarn是 Facebook 提供的替代 npm 的工具,可以加速 node 模块的下载
Yarn官方文档
brew install yarn
yarn -v
brew upgrade yarn
yarn init
安装完 yarn
后同理也要设置镜像源:
yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global
安装完 yarn
之后就可以用 yarn
代替 npm
了,例如用yarn
代替npm install
命令,用yarn add 某第三方库名
代替npm install --save 某第三方库名
。
4. react-native-cli
react-native-cli
: React Native
的命令行工具
npm install -g yarn react-native-cli
5. Watchman:
由 Facebook 提供的监视文件系统变更的工具。
brew install watchman
watchman -v
6. Flow:
是一个静态的 JS 类型检查工具
brew install flow
flow version
7. Nuclide:
由 Facebook
提供的基于atom
的集成开发环境, 可用于编写、运行和调试React Native
应用。
8. Xcode
做iOS开发的对此非常熟悉,非iOS开发,请到App Store下载
9. CocoaPods
做iOS开发的对此非常熟悉,非iOS开发,请百度下如何安装
10. 查看react和react-native的版本号
npm info react
npm info react-native