React Native 筹建
React Native 搭建
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew -v brew install nvm mkdir ~/.nvm vim ~/.bash_profile export NVM_DIR=~/.nvm source $(brew --prefix nvm)/nvm.sh nvm nvm -v brew info nvm nvm install node && nvm alias default node brew --cache nvm install node && nvm alias default node nvm use --delete-prefix v5.5.0 node -v npm -v brew install watchman brew install flow npm install -g react-native-cli react-native REACT-NATIVE INIT 卡很久的解决方法 这是由于需要链接到React-Native官网去下载库。没有FQ有时候下载不了的关系。可以用淘宝的代理镜像: 镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在): 1.通过config命令 npm config set registry https://registry.npm.taobao.org npm info underscore (如果上面配置正确这个命令会有字符串response) 2.命令行指定 npm --registry https://registry.npm.taobao.org info underscore 3.编辑 ~/.npmrc 加入下面内容 registry = https://registry.npm.taobao.org