How To Install And Setup React Native On Windows 10
How To Install And Setup React Native On Windows 10
React Native is a powerful framework for building cross-platform mobile applications using JavaScript. If you’re a Windows user, follow these steps to set up React Native on your machine:
Installation
1/ Install Chocolatey
Chocolatey is a package manager for Windows that simplifies software installation. Open a terminal (Windows Command Prompt or PowerShell) and run the following command to install Chocolatey:
choco install chocolatey
2/ Install Node, Python2, and JDK8
React Native requires Node.js, Python2, and JDK8. You can install them using Chocolatey:
choco install nodejs.install python2 jdk8
3/ Install Android Studio
Android Studio is essential for React Native development on Windows. Download and install Android Studio from the official website. During installation, make sure to select the Android SDK components you need.
4/ Set up Android SDK
After installing Android Studio, open it and go to the “SDK Manager.” Install the following components:
- Android SDK
- Android SDK Platform
- Android Virtual Device (AVD)
5/ Install React Native CLI
Open Command Prompt or PowerShell and run the following command to install React Native globally:
npm install -g react-native-cli
6/ Creating a New Application
- Connect an Android device to your computer via USB or set up an Android emulator using Android Studio.
- Make sure USB debugging is enabled on your device.
7/ Running the Application
- In the terminal, navigate to the directory where you want to create your project.
- Run the following command to create a new React Native project (replace
MyApp
with your desired project name):
react-native init MyApp
8/ Run Your React Native App
- Change into the project directory:
- Start the Metro bundler (JavaScript packager):
- In a separate terminal, build and run your app on the connected Android device or emulator:
cd MyApp
npx react-native start
npx react-native run-android
That’s it! You’ve successfully set up React Native on Windows 10. Feel free to explore and build your awesome mobile app! 😊
Tip: We recommend using Visual Studio Code as the source-code editor for working with React Native projects.