美文网首页
React Native-Mac环境搭建

React Native-Mac环境搭建

作者: _凌浩雨 | 来源:发表于2019-02-22 12:18 被阅读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设置镜像源
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

相关文章

网友评论

      本文标题:React Native-Mac环境搭建

      本文链接:https://www.haomeiwen.com/subject/brmdyqtx.html