Why?
React Native requires Node.js to run JavaScript code and manage packages.
Steps:
node -v
npm -v
brew install watchman
Why?
React Native requires Java Development Kit (JDK) 17 for Android development.
Download JDK 17 from Oracle or OpenJDK
Set JAVA_HOME environment variable:
macOS/Linux:
export JAVA_HOME=$(/usr/libexec/java_home)
Windows:
Go to Control Panel → System → Environment Variables → Add JAVA_HOME
Why?
Android Studio provides the Android SDK and emulator tools for Android development.
Download from: https://developer.android.com/studio
During installation, ensure these are selected:
Why?
Environment variables help React Native find Android SDK tools.
macOS/Linux (add to ~/.zshrc or ~/.bash_profile):
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
Then run:
source ~/.zshrc
Windows:
ANDROID_HOME = %LOCALAPPDATA%\Android\Sdk
Update Path:
%LOCALAPPDATA%\Android\Sdk\platform-tools
%LOCALAPPDATA%\Android\Sdk\emulator
Why?
It allows project creation and build commands from terminal.
npm install -g react-native-cli
Or follow the latest steps via official docs
Run:
npx react-native init MyApp
Navigate to your app folder:
cd MyApp
npx react-native run-android
npx react-native run-ios # macOS only
If you see the welcome screen on your emulator/device, you're done!
| Step | Why | Command |
|---|---|---|
| 1 | Install Node.js & Watchman | Download Node.js |
| 2 | Install Java JDK 17 | OpenJDK 17 |
| 3 | Install Android Studio | Android Studio |
| 4 | Set Up Env Variables | ANDROID_HOME and PATH |
| 5 | Install React Native CLI | npm install -g react-native-cli |
| 6 | Create Project | npx react-native init MyApp |
| 7 | Run Project | npx react-native run-android / run-ios |
| 8 | Verify Setup | Open App in Emulator or Device |
Congratulations! You’ve completed the React Native setup. Start coding and building your mobile app!
Facing issues? Check the official docs or visit forums like Stack Overflow.