React Native 使用Yarn, Yarn是Facebook提供的替代npm的工具,可以加速node模块的下载
1. 安装Yarn:
npm install -g yarn react-native-cli
2. 设置国内镜像:
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
3. 命令, 参考:https://blog.csdn.net/u013233097/article/details/78652728
react-native init projectname
npm install --> yarn
npm install --save react-navigation --> yarn add react-navigation