React Native-Mac环境搭建

2019-02-22  本文已影响1人  _凌浩雨
1). 安装Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装教程

2). 安装Node和Watchman
brew install node
brew install watchman
3). npm 设置镜像源
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
4). 安装Yarn、React Native 的命令行工具(react-native-cli)
npm install -g yarn react-native-cli
yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global

安装完 yarn 之后就可以用 yarn 代替 npm 了,例如用yarn代替npm install命令,用yarn add 某第三方库名代替npm install 某第三方库名。

5). 创建新项目
react-native init Test
6). 效果
效果.png
上一篇 下一篇

猜你喜欢

热点阅读