React Native is based on Nodejs, so it is not possible to develop it on Windows. If we only developed Android apps with React Native, we could have done it on Windows.
Here’s how to set up a React Native environment on Windows:
Install Nodejs
Please go to the official website [1] to download Nodejs for Windows. I directly downloaded version 5.0. React Native requires 4.0 or higher.
Install the react – native – cli
install -g react-native-cli |
Initialize the project
react-native init AwesomeProject |
Init project, I got stuck for a long time to complete the initialization, probably because downloading node_modules took too long. If you get stuck in init, you can clone the project I initialized
git clone https://github.com/chenyangcun/AwesomeProject.git |
After downloading the code, unzip node_modules.zip from your project directory to your current directory.
Note: If you have a fast network, you can also download node_modules using NPM install
Configuring environment Variables
Please set the environment variable ANDROID_HOME to point to the Android SDK directory
[2]
Install the Genymotion emulator
Please download and install Genymotion emulator from the official Genymotion[4] and create Android Emulator. Please refer to facebook’s notes [5]
1. Start the React Native Server
react-native start |
2. Open a new terminal (CMD) and switch to the project directory to install the APP
cd android |
Before running gradlew. Bat installDebug, start Genymotion emulator first
Once installed, manually open the APP in Genymotion, and if everything works, you’ll see the following screen. At this point, the React Native development environment for Windows has been built. [6]
This article is originally published by Yang Chunmian blog [8]. The original address: www.aswifter.com/2015/11/17/… [9]
Welcome to follow my wechat public account to share Android,IOS,Swift development and Internet content wechat account: APP developer [10] [11]
[12]