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


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

查看所有标签

猜你喜欢:

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

Mastering JavaServer Faces

Mastering JavaServer Faces

Bill Dudney、Jonathan Lehr、Bill Willis、LeRoy Mattingly / Wiley / 2004-6-7 / USD 40.00

Harness the power of JavaServer Faces to create your own server-side user interfaces for the Web This innovative book arms you with the tools to utilize JavaServer Faces (JSF), a new standard that wi......一起来看看 《Mastering JavaServer Faces》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换