其中在搭建环境中需要安装react-native命令行工具react-native-cli,需要执行npm install -g,国内需要使用淘宝镜像安装,有以下三种方式:
1.通过config命令
npm config set registry https://registry.npm.taobao.org
npm install -g (如果上面配置正确这个命令会有字符串response)
2.命令行指定
npm --registry https://registry.npm.taobao.org install -g
3.编辑 ~/.npmrc
加入下面内容
registry = https://registry.npm.taobao.org
踩坑专访:http://www.cnblogs.com/meteoric_cry/p/4874517.html