美文网首页
Android React-Native 入门笔记(一) Wi

Android React-Native 入门笔记(一) Wi

作者: RoyAlex | 来源:发表于2018-02-28 10:55 被阅读32次

搭建环境

内容摘自:
React-Native中文

1. (必须)安装Chocolately

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

期间尽量使用vpn工具

2. 安装Python 2

choco install python2

3. 安装NodeJs

choco install nodejs.install

安装之后使用npm设置代理

npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global

使用Yarn替代NPM来安装远程包,加速工程的开发

安装Yarn 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

新建项目和运行项目

使用CMD命令CD到你要创建项目的目录下面,使用如下命令:

react-native init AwesomeProject
cd AwesomeProject
react-native run-android

下一节:props属性

相关文章

网友评论

      本文标题:Android React-Native 入门笔记(一) Wi

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