Skip to main content

🔧 Installing the Toolchain

Setting up everything you need to build React Native apps

🎯 Learning Objectives

By the end of this lesson, you will have:

  • Installed Node.js and a package manager (npm or yarn)
  • Set up a code editor with React Native extensions
  • Installed Expo Go on your physical device
  • Configured iOS Simulator (Mac) and/or Android Emulator
  • Verified your environment is working correctly

⏱️ Estimated Time: 30-60 minutes (depending on downloads)

📑 In This Lesson

What You'll Install

Before we create our first project, we need to set up our development environment. The good news? With Expo, the setup is much simpler than traditional native development. No Xcode project files to configure, no Android Gradle headaches (at least not yet).

Here's the complete toolchain we'll set up:

Your Development Toolchain 📦 Node.js JavaScript runtime 📝 VS Code Code editor 📱 Expo Go Testing app 🖥️ Simulators iOS / Android What each tool does: Node.js — Runs JavaScript outside the browser. Required for all React Native tooling. VS Code — Write and edit your code. Extensions add React Native superpowers. Expo Go — Run your app on a real phone without building native code. Simulators — Test on virtual iOS/Android devices on your computer.

The four pillars of your React Native development environment

⏱️ Time Expectations

  • Node.js: 5-10 minutes
  • VS Code + Extensions: 10 minutes
  • Expo Go: 2 minutes
  • iOS Simulator (Mac only): 10-30 minutes (Xcode download is large)
  • Android Emulator: 20-40 minutes (Android Studio download is large)

Pro tip: Start the large downloads first, then set up the smaller tools while waiting!

Node.js and Package Manager

Node.js is the foundation. It runs JavaScript outside the browser, and all React Native tooling (Metro bundler, Expo CLI, etc.) runs on Node. You need Node.js version 18 or newer (LTS recommended).

Check If You Already Have Node

Open your terminal and run:

# Check Node.js version
node --version

# Check npm version (comes with Node)
npm --version

If you see version numbers (Node 18+ and npm 9+), you're good! Skip to the next section.

Installing Node.js

💡 Recommended: Use a Version Manager

Instead of installing Node directly, we recommend using a version manager. This lets you switch between Node versions easily and avoids permission issues.

Option A: Using nvm (Recommended for Mac/Linux)

# Install nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# Restart your terminal, then install Node LTS
nvm install --lts

# Verify installation
node --version  # Should show v20.x.x or v22.x.x

Option B: Using nvm-windows (Windows)

  1. Download the installer from nvm-windows releases
  2. Run the installer
  3. Open a new PowerShell or Command Prompt window
  4. Run:
# Install latest LTS version
nvm install lts

# Use the installed version
nvm use lts

# Verify
node --version

Option C: Direct Installation

If you prefer not to use a version manager:

  1. Go to nodejs.org
  2. Download the LTS version (not Current)
  3. Run the installer
  4. Restart your terminal and verify with node --version

Package Manager: npm vs Yarn vs pnpm

npm comes bundled with Node.js and works great. You can also use Yarn or pnpm if you prefer:

Manager Install Command Notes
npm Included with Node Default choice, works everywhere ✓
Yarn npm install -g yarn Faster installs, widely used
pnpm npm install -g pnpm Most efficient disk usage

✅ Our Recommendation

Stick with npm for this course. It's the default, well-documented, and has no compatibility issues. All our examples use npm commands.

Code Editor Setup

You can use any code editor, but we strongly recommend Visual Studio Code. It's free, fast, and has excellent React Native support.

Installing VS Code

  1. Go to code.visualstudio.com
  2. Download for your operating system
  3. Run the installer

Essential Extensions

Open VS Code and install these extensions (click the Extensions icon in the sidebar or press Ctrl/Cmd + Shift + X):

Extension What It Does Priority
ES7+ React/Redux/React-Native snippets Code snippets for faster typing Essential ⭐
ESLint JavaScript/TypeScript linting Essential ⭐
Prettier - Code formatter Automatic code formatting Essential ⭐
React Native Tools Debugging and IntelliSense Recommended
Error Lens Shows errors inline Recommended
Auto Rename Tag Renames paired JSX tags Nice to have
Color Highlight Shows colors in code Nice to have

Recommended VS Code Settings

Open Settings JSON (Ctrl/Cmd + Shift + P → "Preferences: Open Settings (JSON)") and add:

{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.tabSize": 2,
  "editor.wordWrap": "on",
  "emmet.includeLanguages": {
    "javascript": "javascriptreact",
    "typescript": "typescriptreact"
  },
  "files.associations": {
    "*.js": "javascriptreact",
    "*.ts": "typescriptreact"
  }
}

💡 Format on Save

The "editor.formatOnSave": true setting is a game-changer. Combined with Prettier, your code gets automatically formatted every time you save. No more arguing about semicolons or indentation!

Expo Go on Your Device

Expo Go is an app you install on your phone that lets you run your React Native projects without building native code. It's the fastest way to see your app on a real device.

Installing Expo Go

iPhone / iPad

Search "Expo Go" in the App Store

Or scan:

App Store QR Code

iOS 13.0 or later

🤖 Android

Search "Expo Go" in the Play Store

Or scan:

Play Store QR Code

Android 6.0 or later

⚠️ Same Network Required

Your phone and computer must be on the same WiFi network for Expo Go to connect to your development server. If you're on a corporate network with device isolation, you may need to use a simulator instead or create a development build.

How Expo Go Works

sequenceDiagram
    participant Phone as 📱 Expo Go
    participant Server as 💻 Metro Bundler
    participant Code as 📁 Your Code
    
    Phone->>Server: Scan QR code / Connect
    Server->>Code: Watch for changes
    Server->>Phone: Send JavaScript bundle
    Phone->>Phone: Run app
    
    Note over Code: You edit a file
    Code->>Server: File changed!
    Server->>Phone: Send update
    Phone->>Phone: Hot reload ⚡
                

Expo Go connects to your development server and receives live updates

Simulators and Emulators

While testing on a real device is important, simulators let you test without grabbing your phone every time. They're also essential for testing different screen sizes and OS versions.

📖 Simulator vs Emulator

  • iOS Simulator — Simulates iOS; only runs on Mac
  • Android Emulator — Emulates Android; runs on Mac, Windows, and Linux

The distinction is technical — for our purposes, they both let you test your app on a virtual device.

iOS Simulator (Mac Only)

The iOS Simulator requires Xcode, which is only available on macOS.

Installation Steps:

  1. Open the App Store on your Mac
  2. Search for Xcode
  3. Click Get (it's free but large — ~12GB)
  4. Wait for the download and installation
  5. Open Xcode once to accept the license agreement
  6. Install command line tools:
# Install Xcode command line tools
xcode-select --install

# Verify installation
xcode-select -p
# Should output: /Applications/Xcode.app/Contents/Developer

Opening the Simulator:

# Open iOS Simulator directly
open -a Simulator

# Or from Xcode: Xcode → Open Developer Tool → Simulator

✅ Pro Tip: Skip the Full Xcode

If disk space is tight, you can install just the Command Line Tools and use Expo Go on your iPhone instead of the simulator. You only need full Xcode for the iOS Simulator or production builds.

🤖 Android Emulator (All Platforms)

The Android Emulator is part of Android Studio. Even if you don't write native Android code, you need Android Studio for the emulator.

Installation Steps:

  1. Go to developer.android.com/studio
  2. Download Android Studio
  3. Run the installer
  4. During setup, ensure these are checked:
    • Android SDK
    • Android SDK Platform
    • Android Virtual Device
  5. Complete the installation wizard

Creating an Emulator (AVD):

  1. Open Android Studio
  2. Click More Actions (or Configure) → Virtual Device Manager
  3. Click Create Device
  4. Select a phone (e.g., Pixel 7)
  5. Select a system image:
    • Click the Recommended tab
    • Choose a recent API level (e.g., API 34 / Android 14)
    • Click Download if needed
  6. Click NextFinish

Running the Emulator:

# From Android Studio: 
# Virtual Device Manager → Click Play button on your device

# From command line (after adding to PATH):
emulator -avd Pixel_7_API_34

Setting up Environment Variables (Important!):

Expo needs to know where Android SDK is installed. Add these to your shell profile:

Mac/Linux (~/.bashrc, ~/.zshrc, or ~/.bash_profile):

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools

Windows (System Environment Variables):

# Set ANDROID_HOME to:
C:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk

# Add to PATH:
%ANDROID_HOME%\emulator
%ANDROID_HOME%\platform-tools

After adding, restart your terminal and verify:

# Should output the SDK path
echo $ANDROID_HOME   # Mac/Linux
echo %ANDROID_HOME%  # Windows

# Should show available emulators
emulator -list-avds

⚠️ Performance Note

Android Emulator can be slow without hardware acceleration. Make sure:

  • Mac: Hardware acceleration works automatically
  • Windows: Enable HAXM or Hyper-V (Android Studio will prompt)
  • Linux: Install KVM for hardware acceleration

Verification Checklist

Let's verify everything is installed correctly. Run these commands in your terminal:

# 1. Node.js (should be 18+)
node --version

# 2. npm (should be 9+)
npm --version

# 3. Check VS Code is installed (opens VS Code)
code --version

# 4. Android SDK (should output path)
echo $ANDROID_HOME   # Mac/Linux
# or
echo %ANDROID_HOME%  # Windows

# 5. List Android emulators (should show at least one)
emulator -list-avds

# 6. iOS Simulator (Mac only - should open Simulator)
open -a Simulator

✅ Verification Checklist

☐ Node.js version 18 or higher
☐ npm version 9 or higher
☐ VS Code installed with extensions
☐ Expo Go installed on phone
☐ At least ONE of: iOS Simulator / Android Emulator / Physical device

💡 Minimum Viable Setup

At minimum, you need:

  • Node.js + npm
  • A code editor
  • At least one testing method: Expo Go on phone, iOS Simulator, or Android Emulator

You don't need ALL testing methods — one is enough to start learning!

Troubleshooting Common Issues

node: command not found

Cause: Node.js isn't in your PATH, or terminal needs restart.

Fix:

  1. Close and reopen your terminal
  2. If using nvm: run nvm use --lts
  3. Reinstall Node.js if needed
EACCES: permission denied (npm)

Cause: npm trying to install globally without permission.

Fix:

  1. Best: Use nvm (avoids permission issues entirely)
  2. Or: Fix npm permissions: npm guide
  3. Avoid: Don't use sudo npm — it causes more problems
Android Emulator: "PANIC: Cannot find AVD system path"

Cause: ANDROID_HOME not set correctly.

Fix:

  1. Set ANDROID_HOME as described above
  2. Restart terminal
  3. Verify: echo $ANDROID_HOME
Android Emulator extremely slow

Cause: Hardware acceleration not enabled.

Fix:

  • Windows: Enable HAXM (Intel) or Windows Hypervisor Platform in Android Studio SDK Manager
  • Linux: Install and enable KVM
  • Use an x86 system image, not ARM
Xcode: "No profiles for 'com.apple...' were found"

Cause: This is for production builds, not simulator.

Fix: For simulator testing, you don't need profiles. This only matters when building for physical iOS devices or App Store.

Expo Go can't connect to development server

Cause: Network or firewall issue.

Fix:

  • Ensure phone and computer are on same WiFi
  • Disable VPN if active
  • Check firewall isn't blocking port 8081
  • Try "tunnel" connection: npx expo start --tunnel

Summary

🎉 Environment Ready!

You've installed:

  • Node.js — The JavaScript runtime that powers all RN tooling
  • VS Code — Your code editor with helpful extensions
  • Expo Go — For testing on your real device
  • Simulators/Emulators — For testing on virtual devices

🚀 What's Next?

Your environment is ready! In the next lesson, we'll use these tools to create your first React Native project. You'll see your app running on a device in minutes!

🛠️ Setup Complete!

The boring part is done. Now the fun begins — let's create something!