React Native (RN) is a cross-platform mobile application development framework that Facebook opened source in April 2015. React Native is also a JavaScript library for building Web-based interfaces.

As for which OS RN is easy to develop on, MY first recommendation is MacOS, not only because MacOS supports XCode for ios applications, but even FOR Android I like MacOS. However, this article is based on the Windows environment to build, 囧.

Let’s begin by looking at RN’s setup in a Windows development environment.


1. Install Node.js:

Download it, execute setup, go to Next, and install the environment variables by default.

Download it at nodejs.org/en/

After the installation is complete, run the command line interface (CLI), open the CMD window, and enter node -v. The Node version is displayed, indicating that the installation is successful.

2. Set the NPM domestic mirror

With Node.js installed, we can now use the NPM command. NPM is a package management tool for JavaScript and is the default package management tool for the Node.js platform. NPM allows you to install, share, distribute code, and manage project dependencies.

Because the source of NPM is abroad, it is not convenient for domestic users. Therefore, domestic mirroring can be configured to improve the access speed.

CMD command line window input: NPM config set registry at https://registry.npm.taobao.org

After the command is executed, run the NPM config get registry command to check whether the image paths configured are consistent.

3. Install the react-native cli tool

The react-native CLI is a plug-in of Node.js. It can be used to run the React Native command on the cli and check whether the JS file on the server is updated when the React Native application is started.

Install the react-native cli plug-in:

NPM install -g react-native-cli by defaultCopy the code
// Install the specified version NPM install -g [email protected]Copy the code

After installing the react-native –version command, run the react-native –version command

4. Others: CNPM YARN

Install Taobao CNPM:

npm install -g cnpm --registry=https://registry.npm.taobao.org
Copy the code

Check CNPM:

cnpm -v
Copy the code

Yarn is a package management tool published by Facebook to replace NPM.

NPM install -g YARN

View the version: yarn –version


That’s all about configuring RN’s environment on Windows.

Homebrew is recommended for Installing Node and Watchman if you are running on MacOS. But Watchman is not required for Windows.