加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react-native:环境安装

发布时间:2020-12-15 03:30:48 所属栏目:百科 来源:网络整理
导读:环境要求:OS X ,要开发ios App就必须使用Mac OS系统。 Homebrew:安装教程http://brew.sh/,Mac上的包管理软件 Node.js :https://nodejs.org/en/ watchman:https://facebook.github.io/watchman/docs/install.htmlfacebook的一个文件监视系统。 flow:http:

环境要求:OS X ,要开发ios App就必须使用Mac OS系统。
Homebrew:安装教程http://brew.sh/,Mac上的包管理软件
Node.js :https://nodejs.org/en/
watchman:https://facebook.github.io/watchman/docs/install.htmlfacebook的一个文件监视系统。
flow:http://flowtype.org/js的变量检查

安装

安装Homebrew:

/usr/bin/ruby -e "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"

安装node.js

brew install node

安装watchman

brew install watchman

安装flow

brew install flow

更新当前软件到最新版本

更新Homebrew版本库

brew update

更新软件

brew upgrade

安装react-native

npm install -g react-native-cli

─┬ react-native-cli@0.1.10
  ├─┬ chalk@1.1.1
  │ ├─┬ ansi-styles@2.2.0
  │ │ └── color-convert0.0
  │ ├── escape-string-regexp5
  │ └── strip-ansi@3.1
  ├─┬ prompt2.14
  │ ├─┬ read7
  │ │ └── mute-stream6
  │ └─┬ utile2.1
  │   ├── i3.4
  │   └─┬ rimraf5.2
  │     └─┬ glob@7.0
  │       ├─┬ minimatch0
  │       │ └─┬ brace-expansion1.3
  │       │   └── balanced-match3.0
  │       └── once3.3
  └── semver@5.1.0

react-native安装成功

第一个react-native项目

react-native init HelloRN

o run your app on iOS:
   cd /Users/***/Documents/github/react-native/HelloRN
   react-native run-ios
   - or -
   Open /Users/***/Documents/github/react-native/HelloRN/ios/HelloRN.xcodeproj in Xcode
   Hit the Run button
To run your app on Android:
   Have an Android emulator running (quickest way to get started),or a device connected
   cd /Users/***/Documents/github/react-native/HelloRN
   react-native run-android

运行

react-native run-ios

在当前目录下面多了一个ios的目录,里面新建一个project,HelloRN的项目。

react-native run-android

在当前目录下会多出一个anroid的目录,里面是android项目的文件。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读