美文网首页
又一次的mac配置RN环境,这次决定写一下

又一次的mac配置RN环境,这次决定写一下

作者: dxin_101 | 来源:发表于2018-05-07 19:16 被阅读0次

废话不多说,必要的硬件环境必须要有,进入正文。

1 . 安装Homebrew 终端上粘贴:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

2.安装Node:brew install node

3.安装npm:npm install -g react-native-cli

4.安装yarm:npm install -g yarn react-native-cli

5安装watchman:brew install watchman

Whtchman是Facebook开发的一个检测文件系统变化的工具,在RN开发中可以检测js文件等是否有变化,从而达到保存及编译的效果。这个在windows中也有,个人觉得可装也可以不装,直接手机上reload也是可以的。」

6.安装 flow(静态类型检查工具):brew install flow

7.转话镜像:npm config set registry https://registry.npm.taobao.org --global

npm config set disturl https://npm.taobao.org/dist --global

8.创建工程

react-native init HelloWord

cd HelloWord

react-native run-ios

如果最后一句不能执行,那就运行xcode

相关文章

网友评论

      本文标题:又一次的mac配置RN环境,这次决定写一下

      本文链接:https://www.haomeiwen.com/subject/llbvrftx.html