React Native installation has two main paths: Expo for beginners, or classic React Native CLI for advanced use. reactnative
Here’s a quick roadmap (Windows/macOS summary); tell me your OS for detailed, copy-paste steps.
Basic Requirements
- Node.js 18+ LTS (download from nodejs.org). reactnative
- npm comes with Node; optionally install Yarn (
npm install -g yarn). dera.hashnode - Use VS Code or similar editor. microsoft.github
Mobile Tools
Android (Windows & macOS)
- Install Android Studio. instamobile
- Select “Android SDK”, “Android SDK Platform”, “Android Virtual Device” during setup. reactnative
- Create an emulator (Pixel template, API 34+ image). reactnative
On Windows, also set JAVA JDK 17, JAVA_HOME, and ANDROID_HOME env vars. instamobile
iOS (macOS only)
- Requires Mac; install Xcode from App Store. microsoft.github
- Run
sudo gem install cocoapodsfor CocoaPods. microsoft.github
Expo Quick Start (Recommended)
- Install Expo CLI:
npm install -g @expo/cliinstamobile - Create project:
npx create-expo-app myAppreactnative - Run:
cd myApp npx expo startScan QR with Expo Go app or use emulator. reactnative
React Native CLI Setup
- New project:
npx react-native init MyAppmicrosoft.github - Android:
cd MyApp npx react-native run-android ``` [dera.hashnode](https://dera.hashnode.dev/how-to-set-up-react-native-on-mac-os) - iOS (macOS):
cd ios && pod install && cd .. npx react-native run-ios ``` [dera.hashnode](https://dera.hashnode.dev/how-to-set-up-react-native-on-mac-os)
Desktop (Optional)
Add React Native for Windows or React Native for macOS. learn.microsoft
- Windows:
npx react-native-windows-init --overwrite, thennpx react-native run-windows. learn.microsoft - macOS:
npx react-native-macos-init, thennpx react-native run-macos. microsoft.github
Specify your OS (Windows/macOS/Linux) and Expo vs. CLI preference for a tailored, command-by-command guide.