随着Facebook开源ReactNative,目前越来越多的公司开始在项目中引入此开源框架,所以现在也加入到学习中来。
一 .环境配置
在mac上搭建React环境需要下面这些工具
Android Studio, node.js, the React Native command line tools, and Watchman.
首先来安装 node 和Watchman
这里我是通过 Homebrew来安装的,安装很简单打开mac的终端将
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
这段粘贴到命令行中即可,等它安装好了,就可以安装node来
具体命令为
brew install node
同理Watchman也是同样安装命令为
brew install watchman
安装好了以后就开始安装 React Native command line tools
在这之前已经安装了node了,所以在这通node npm来安装具体命令如下:
npm install