Build a reactnative development environment on your Mac

Source: Internet
Author: User
Tags install node sublime text

1. Install the homebrew, Mac System Package Manager for installing Nodejs and some other required tool software.

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


2. Install node. js

2.1 software can be downloaded from the node. JS website for installation.

2.2 Installing node. js using the homebrew installed in the first step

node


Set up a mirror source

npm config set registry https://registry.npm.taobao.org --globalnpm config set disturl https://npm.taobao.org/dist --global
3.安装react-native-cli命令行工具


Yarn是Facebook提供的替代npm的工具,可以加速node模块的下载。React Native的命令行工具用于执行创建、初始化、更新项目、运行打包服务(packager)等任务。

npm install -g yarn react-native-cli

设置镜像源

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

用init命令默认创建最新的版本,
AwesomeProject是项目的名称
react-native init AwesomeProject

进入项目cd AwesomeProject

安装xcode之后,可以执行以下命来运行项目react-native run-ios








 
Recommended Tools for installation

Watchman is a tool for monitoring file system changes provided by Facebook. Installing this tool can improve performance at development time (Packager can quickly capture file changes for real-time refresh).

brew install watchma

Flow is a static JS type Check tool. What you see in many examples is the weird colon question mark, and the same syntax as the type in the method parameter, which is the grammar of the flow tool. This syntax does not belong to the ES Standard, just Facebook's own code specification. So the Novice can skip directly (i.e. no need to install the tool, and it is not recommended to bother learning flow-related syntax).

brew install flow

Nuclide (this link requires scientific Internet access) is an atom-based, integrated development environment provided by Facebook that can be used to write, run, and debug react native applications.

Click here to read Nuclide's Getting started documentation.

We recommend that you use Webstorm or sublime text to write react native applications.

 









 
 

Build a reactnative development environment on your Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.