A Beginner’s Guide to Clean Installation of React Native on Windows (With Fixes to Common Errors)

If you’re a beginner struggling to set up a React Native environment on a Windows machine, you’re not alone. In this guide, I’ll walk you through the correct way to install React Native from scratch and provide fixes to common errors I personally encountered.
🛠️ Prerequisites
Node.js: Install the latest LTS version from nodejs.org
Java Development Kit (JDK): Install JDK 17 or higher.
Android Studio: Install it from developer.android.com
Expo CLI (optional):
npm install -g expo-cli
🌀 Initializing the React Native Project
npx react-native init MyAwesomeApp
cd MyAwesomeApp
📂 File and Folder Structure (Important)
Ensure you always run commands like npx react-native run-android
from the project root folder, not the /android
subfolder. Running it from the wrong folder may lead to partial builds or emulator failures.
💣 Common Errors & Their Fixes
❌ Error 1: NDK did not have a source.properties file
Cause:
You installed an NDK manually or through Android Studio that’s broken or incomplete.
Solution:
Open Android Studio → Appearance & Behavior → System Settings → Android SDK → SDK Tools
Select NDK (Side by side) and choose version:
25.2.9519653
Delete broken NDK folders, e.g.
C:\Users\YourUsername\AppData\Local\Android\Sdk\ndk\27.1.12297006
Keep only the stable one.
❌ Error 2: ./gradlew
.\gradlew clean
Make sure you're inside the /android
directory.
❌ Error 3: Failed to launch emulator
Cause:
React Native CLI couldn’t auto-launch the emulator.
Solution:
Manually start the emulator:
"C:\Users\YourUsername\AppData\Local\Android\Sdk\emulator\emulator.exe" @Your_AVD_Name
Then re-run:
npx react-native run-android
❌ Error 4: Missing local.properties file
Solution:
Inside /android
folder, create a file named local.properties
and add:
sdk.dir=C:\Users\YourUsername\AppData\Local\Android\Sdk
Replace YourUsername
with your actual Windows username.
🔁 Want a Clean Slate? How to Restart From Scratch
Delete your entire React Native project folder:
rm -rf MyAwesomeApp
Delete Gradle cache:
C:\Users\YourUsername\.gradle
Reinstall:
npx react-native init MyAwesomeApp cd MyAwesomeApp npx react-native run-android
Subscribe to my newsletter
Read articles from Mausumi Nanda directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
