1.官网:
开始react-natvie

2.安装HomeBrew命令:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

3.安装NVM命令:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

或者:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

4.编辑.bash_profile文件:

export NVM_DIR="/Users/liyanfeng/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

5.安装node:

nvm install node && nvm alias default node;

6.获取权限:

sudo chown -R $USER /user/local/lib
sudo chown -R $USER /user/local

7.安装wathman和flow:

brew install watchman && brew install flow

8.安装react-native-cli:

sudo npm install -g react-native-cli

ps:react-native全局变量会破坏ReactNatvie环境,查看全局安装的命令:

npm list -g

9.安装代码检测插件:

npm install -g JSHint
which jshint