- 安装node.js 和npm https://nodejs.org/en/
$ brew install node
查看版本:
node -v
npm -v
或者官网下载:
Node.js was installed at
/usr/local/bin/node
npm was installed at
/usr/local/bin/npm
Make sure that /usr/local/bin is in your $PATH.
- 安装watchman:监控文件变化,检测bug
brew install watchman
查看版本:
watchman -v
- 安装flow:静态类型检查器,查找出代码出可能存在的错误
brew install flow
- 安装react native
npm install -g react-native-cli
创建项目
react-native init helloword
运行项目
进入项目根目录:cd helloword
运行IOS的命令:react-native run-ios
网友评论