RN-1.Install
2018-01-03 本文已影响0人
傻Xiao
node
- nvm管理node
github地址- 下载安装
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
- 设置环境变量
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
- 一些nvm命令
nvm ls # 显示当前已安装版本 nvm ls-remote # 显示远程服务器版本 nvm install <version> # 安装指定版本 nvm use <version> # 使用指定版本
- 下载安装
watchman
brew install watchman
Watchman is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.
RN CLI
npm install -g react-native-cli
更新Xcode
create project
- 构建项目
react-native init test
- 运行
cd test react-native run-ios
- 看到Welcome to React Native!