Installation
This guide walks you through the process of installing React Native and setting up your development environment. By the end of this guide, you'll be ready to start building your first React Native application.
Prerequisites
Before proceeding with the installation, make sure you have the following software and tools installed:
- Node.js and npm
- Git
- Watchman (Optional but recommended)
- JDK (For Android development)
- Android Studio (For Android development)
- Xcode (For iOS development, macOS only)
If you haven't installed these yet, please refer to the Prerequisites guide.
Installation Steps
Step 1: Install Node.js and npm
If you haven't installed Node.js and npm yet, download and install them from the official Node.js website.
Verify the installation by running the following commands in your terminal:
node -v
npm -vStep 2: Install React Native CLI
You can install the React Native command-line interface (CLI) using npm:
npm install -g react-native-cliVerify the installation:
react-native --versionStep 3: Create a New React Native Project
To create a new React Native project, run the following command:
react-native init MyNewProjectThis will create a new directory called MyNewProject with all the files you need.
Step 4: Run Your React Native Project
Navigate into your project directory:
cd MyNewProjectTo run your project on iOS:
react-native run-iosTo run your project on Android:
react-native run-androidOptional: Using Expo CLI
If you prefer to use Expo for your React Native development, you can install the Expo CLI:
npm install -g expo-cliTo create a new Expo project:
expo init MyNewExpoProjectTo run your Expo project:
cd MyNewExpoProject
expo startNext Steps
Congratulations, you've successfully installed React Native and set up your development environment! You're now ready to start building your first React Native application. For more guidance, check out the Getting Started guide.
Book a conversation with us for personalize training today!
