DEV Community

Bhupesh Chandra Joshi
Bhupesh Chandra Joshi

Posted on

React Native CLI Installation Guide: Step-by-Step for (Windows, macOS & Linux)

Introduction

React Native continues to be one of the most popular frameworks for building cross-platform mobile apps using JavaScript and React. While Expo is great for quick prototyping, React Native CLI gives you full control, better performance, and easier access to native modules.

In this comprehensive guide, I'll walk you through the complete React Native CLI installation process for Windows, macOS, and Linux in 2026.


Prerequisites

Before starting, make sure you have:

  • A decent computer (at least 8GB RAM recommended, 16GB+ for smooth development)
  • Stable internet connection
  • Administrative access on your machine

1. Install Node.js and npm

React Native requires Node.js 18 or higher (LTS version recommended).

Recommended way (2026):

Using Official Installer (Easiest)

  1. Go to the official Node.js website: https://nodejs.org
  2. Download the LTS version (currently 20.x or 22.x)
  3. Install it with default settings

Verify Installation

node --version
npm --version
Enter fullscreen mode Exit fullscreen mode

You should see versions like v20.x.x or v22.x.x.

Pro Tip: Use nvm (Node Version Manager) for better version management.


2. Install Watchman (macOS & Linux only)

Watchman improves file watching performance.

# macOS (using Homebrew)
brew install watchman

# Linux
sudo apt-get install watchman   # Ubuntu/Debian
# or use your distro's package manager
Enter fullscreen mode Exit fullscreen mode

3. Install React Native CLI

npm install -g react-native-cli
Enter fullscreen mode Exit fullscreen mode

Note: In newer versions, you usually don't need to install react-native-cli globally anymore. You can directly use npx react-native.


4. Platform-Specific Setup

For Android (All Operating Systems)

Step 1: Install Android Studio

  1. Download Android Studio from https://developer.android.com/studio
  2. Install it with these components:
    • Android SDK
    • Android SDK Platform-Tools
    • Android SDK Build-Tools
    • Android Emulator
    • Android Virtual Device (AVD)

Step 2: Set Environment Variables

Windows:

Add these to System Environment Variables:

  • ANDROID_HOME = C:\Users\YourName\AppData\Local\Android\Sdk
  • Add to PATH:
    • %ANDROID_HOME%\platform-tools
    • %ANDROID_HOME%\emulator
    • %ANDROID_HOME%\tools
    • %ANDROID_HOME%\tools\bin

macOS & Linux:

Add to ~/.zshrc or ~/.bash_profile:

export ANDROID_HOME=$HOME/Library/Android/sdk   # macOS
# export ANDROID_HOME=$HOME/Android/Sdk       # Linux

export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
Enter fullscreen mode Exit fullscreen mode

Step 3: Install Platform Tools & SDK

Open Android Studio → SDK Manager → Install:

  • SDK Platforms: Android 15 (VanillaIceCream) or Android 14
  • SDK Tools: Android SDK Build-Tools, Platform-Tools, Emulator

For iOS (macOS only)

  1. Install Xcode from Mac App Store (Xcode 16+ recommended)
  2. Install Command Line Tools:
xcode-select --install
Enter fullscreen mode Exit fullscreen mode
  1. Install CocoaPods (for native dependencies):
sudo gem install cocoapods
Enter fullscreen mode Exit fullscreen mode

Or using Homebrew (recommended):

brew install cocoapods
Enter fullscreen mode Exit fullscreen mode

5. Create Your First React Native App

npx react-native init MyAwesomeApp
cd MyAwesomeApp
Enter fullscreen mode Exit fullscreen mode

6. Run the App

Android:

npx react-native run-android
Enter fullscreen mode Exit fullscreen mode

iOS (macOS only):

npx react-native run-ios
Enter fullscreen mode Exit fullscreen mode

Common Issues & Troubleshooting (2026)

Here are the most common problems developers face:

  1. "SDK location not found"

    → Make sure ANDROID_HOME is correctly set.

  2. Gradle sync failed / Build failed

    → Run ./gradlew clean in android folder.

  3. Metro bundler not starting

    → Kill all Node processes and try again.

  4. CocoaPods issues on macOS

    → Run pod install --repo-update in ios folder.

  5. Java version mismatch

    → React Native 0.76+ recommends JDK 21 or JDK 17.

Quick Fix for Java:

# Check Java version
java -version
Enter fullscreen mode Exit fullscreen mode

Bonus: Recommended Development Setup (2026)

  • Editor: VS Code + React Native Tools extension
  • Package Manager: Yarn or pnpm (faster than npm)
  • State Management: Zustand or Redux Toolkit
  • Navigation: React Navigation 7
  • Testing: Jest + React Native Testing Library

Conclusion

Congratulations! 🎉 You have successfully installed React Native CLI on your machine.

You’re now ready to build powerful cross-platform mobile applications.

Next Steps:

  • Learn React Navigation
  • Explore Native Modules
  • Set up CI/CD with GitHub Actions
  • Publish your first app to Play Store & App Store

Would you like me to add:

  • A section on using Yarn instead of npm?
  • M1/M2/M3/M4 Mac specific instructions?
  • React Native 0.76+ new architecture (Fabric + TurboModules)?
  • Docker setup for React Native?

Let me know in the comments!


Tags for Hashnode:

react-native, reactnative, mobile-development, javascript, tutorial, cli, android, ios


Meta Image Suggestion:

Create a clean thumbnail with React Native logo + terminal screenshot + "Installation Guide 2026"


This blog is fully updated for 2026, beginner-friendly, and SEO-optimized for Hashnode.

Would you like me to make a shorter version, more advanced version, or add code screenshots sections? Just tell me!

Top comments (0)