react - 1. 搭建环境

栏目: 服务器 · 发布时间: 7年前

内容简介:最近, 我开始参与我们的手机APP了。项目是用react native 写的。 所以记录一下。入门很容易,有现成的中文文档:

最近, 我开始参与我们的手机APP了。

项目是用react native 写的。 所以记录一下。

入门很容易,有现成的中文文档: https://reactnative.cn/docs/getting-started.html

搭建环境

目前是需要下载JDK 1.8   由于是android环境, 我选择自己的i5 16g 的台式机。用起来爽歪歪。

node: 必须大于 8.3  , 我使用了10.9。

python:  2.x  ,不能 3 以上。 所以我使用了 2.7  (下载: https://www.python.org/downloads/release/python-2715/ )

之后执行命令

# 安装npm源
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global

# 安装 react native 命令行工具
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

然后创建一个新项目: hello

react-native init hello

# 然后会看到一堆生成项目文件的消息。  很有意思。

为gradle设置代理服务器:(如果你在国外可以跳过这一步。 否则在国内会遇到错误)

$ cat ~/.gradle/gradle.properties
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1080
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080

然后执行命令:

$ react-native run-android


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Artificial Intelligence

Artificial Intelligence

Stuart Russell、Peter Norvig / Pearson / 2009-12-11 / USD 195.00

The long-anticipated revision of this #1 selling book offers the most comprehensive, state of the art introduction to the theory and practice of artificial intelligence for modern applications. Intell......一起来看看 《Artificial Intelligence》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

随机密码生成器
随机密码生成器

多种字符组合密码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具