React Native环境搭建
2016-12-14 02:01
323 查看
按步骤在终端执行以下命令即可
1、安装Homebrew
1、安装Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"[/code] 或
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
验证是否安装成功brew -v
2、安装 npm 和 Node.jsbrew install node
3、安装 React Nativenpm install -g yarn react-native-cli或
(sudo)npm install -g react-native-cli
4、安装 WatchMan
brew link autoconf
brew link automakebrew install watchman
5、安装 Flowbrew install flow
6、配置镜像npm config set registry https://registry.npm.taobao.org npm config set disturl https://npm.taobao.org/dist[/code]
7、生成工程
react-native init 项目名称
或react-native init 项目名称 --verbose
8、其他
(1)查看本地的React Native的版本react-native --version(2)更新本地的React Native的版本npm update -g react-native-cli(3)查询react-native的npm包最新版本npm info react-native(4)更新项目中的RN
先要进到项目中cd /Users/targetcloud/Desktop/RN/AHelloworld 然后react-native upgrade
9、安装过程中的错误提示
(1)sudo chown -R `whoami` /usr/local 或sudo chown -R $(whoami):admin /usr/localError: Could not link:
/usr/local/etc/bash_completion.d/brew
Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/doc/homebrew
Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/zsh/site-functions/_brew
Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/man/man1/brew-cask.1
/usr/local/share/man/man1/brew.1
targetclouddeMacBook-Pro:~ targetcloud$ brew update
Already up-to-date.
(2)在brew install watchman之前先执行brew link autoconf和brew link automake
Error: You must `brew link autoconf automake` before watchman can be installed
targetclouddeMacBook-Pro:~ targetcloud$ brew link autoconf
Linking /usr/local/Cellar/autoconf/2.69... 48 symlinks created
targetclouddeMacBook-Pro:~ targetcloud$ brew link automake
Linking /usr/local/Cellar/automake/1.15... 113 symlinks created
targetclouddeMacBook-Pro:~ targetcloud$ brew install watchman
参考
http://reactnative.cn/docs/0.38/getting-started.html
相关文章推荐
- react-native 开发环境搭建
- react native环境搭建for iOS
- React Native 环境搭建 [转]
- react-native —— 在Windows下搭建React Native Android开发环境
- iOS ReactNative环境配置搭建安装React-Native遇到的问题
- React Native打造原生应用之环境搭建
- react-native环境搭建
- 史上最全Windows版本搭建安装React Native环境配置
- Windows环境搭建React Native Android的开发环境
- React Native 入门环境搭建
- React Native windows Android环境搭建
- react-native环境配置——Android工程搭建
- React-Native尝鲜计划-环境搭建及 hello world
- react-native for android windows开发环境搭建详细记录
- React Native iOS 开发环境搭建
- React Native 环境搭建攻略
- react native 环境搭建(iOS)