Lesson 9 of 60 – Setting Up the React Native Development Environment
15%

Setting Up the React Native Development Environment

Before creating React Native mobile applications, we need to prepare our development environment. This includes installing the required software, creating a React Native project, and running the application on a development device or emulator.

Note: In this course, we will begin with the Expo-based workflow because it provides a simpler starting point for learning React Native. Later, you will also learn about native Android and iOS development workflows.

1. What is a Development Environment?

A development environment is the collection of software and tools required to create, run and test applications.

For React Native development, this can include Node.js, a code editor, React Native or Expo tooling, and a device or emulator for testing.

2. Basic Requirements

A basic React Native development setup commonly includes:

  • Node.js
  • npm
  • VS Code or another code editor
  • Expo tooling or React Native Community CLI
  • Android device or emulator for Android testing
  • macOS and Xcode for native iOS development

3. Install Node.js

Node.js provides the JavaScript runtime used by many React Native development tools.

After installing Node.js, open a terminal and check the installation.

node --version

If a version number is displayed, Node.js is available from the terminal.

4. Check npm

npm is the package manager that comes with Node.js installations.

Check whether npm is available:

npm --version

A version number should be displayed when npm is installed correctly.

5. Why Node.js Is Needed

React Native development uses JavaScript tooling and packages that are managed through the Node.js ecosystem.

Commands such as npm install and npx are commonly used during project development.

6. What is npm?

npm is a package manager used to install and manage JavaScript packages.

For example:

npm install

This command installs the packages defined by the project.

7. What is npx?

npx allows developers to execute packages and command-line tools without necessarily installing those tools globally.

For example, Expo projects can be created using:

npx create-expo-app@latest

8. Install VS Code

Visual Studio Code is a popular code editor that can be used for React Native development.

You can use it to:

  • Create files
  • Edit JavaScript or TypeScript
  • Manage project folders
  • Use the integrated terminal
  • Install useful extensions

9. Open the Terminal

The terminal is used to execute React Native development commands.

In VS Code, you can open the integrated terminal from the Terminal menu.

Terminal → New Terminal

You can then run commands directly inside the project.

10. Choose a React Native Workflow

There are different ways to start React Native development.

For this course, we will start with Expo because it provides a beginner-friendly development workflow.

React Native
     ↓
    Expo
     ↓
Mobile Application

11. Create an Expo Project

Create a new Expo React Native project using:

npx create-expo-app@latest my-first-app

This command creates a new project named my-first-app.

12. Move into the Project Folder

After creating the project, move into its directory.

cd my-first-app

The terminal is now working inside your React Native project.

13. Install Project Dependencies

If dependencies have not already been installed, use:

npm install

This installs the packages required by the project.

14. Start the Expo Development Server

Start the development server using:

npx expo start

Expo will start the development environment and display available options for running the application.

15. Expo Development Server

The Expo development server manages the development session and provides ways to open the application on a compatible device or development environment.

npx expo start

The terminal will display information and development options.

16. Run the App on a Physical Android Device

An Expo application can be tested on a physical Android device using a compatible development workflow.

Make sure the computer and device can communicate as required by the selected Expo development method.

For compatible projects, Expo Go can provide a convenient way to run the application during learning and development.

17. Expo Go

Expo Go is a development application that can run compatible Expo projects on a physical device.

It is useful for beginners because it reduces the initial setup required to test many React Native applications.

Remember: Some projects require native modules or configuration that are not available in the standard Expo Go environment. In those cases, use an Expo development build.

18. Android Emulator

An Android emulator is a virtual Android device that runs on your computer.

It allows developers to test mobile applications without always using a physical Android device.

Android Studio provides the tools needed to create and manage Android virtual devices.

19. Android Studio

Android Studio is the official development environment for Android platform development.

It provides tools such as:

  • Android SDK
  • Android Emulator
  • Device Manager
  • Android debugging tools
  • Build tools

For native Android development and emulator-based testing, these tools are important.

20. Android SDK

The Android SDK provides tools and platform components required to build and test Android applications.

When working with native Android projects, React Native uses the Android development environment to build and run the Android application.

21. Java Development Kit

Android development tooling requires a compatible Java Development Kit (JDK).

The required JDK version depends on the React Native and Android Gradle tooling versions being used.

Tip: When setting up a native Android React Native environment, always use the JDK version recommended for your specific React Native version.

22. iOS Development Requirements

Native iOS development requires macOS and Apple's Xcode development tools.

Xcode provides the iOS SDK, simulator and tools required to build and test native iOS applications.

Important: A Windows computer cannot directly run Apple's Xcode environment. Native iOS builds require access to macOS.

23. Check the Project

After creating your project, open it in VS Code.

code my-first-app

You can also open the project folder manually in VS Code.

Explore files such as package.json and the application's source files.

24. package.json

The package.json file contains important information about the JavaScript project.

It can contain:

  • Project name
  • Scripts
  • Dependencies
  • Development dependencies
  • Project metadata
{
    "name": "my-first-app",
    "version": "1.0.0"
}

25. Start the Development Workflow

Install Node.js
      ↓
Check Node & npm
      ↓
Install / Use Expo
      ↓
Create Project
      ↓
Open Project
      ↓
Install Dependencies
      ↓
Start Development Server
      ↓
Run on Device / Emulator

This is the basic workflow you will use repeatedly while learning React Native.

26. Common Setup Problem: Node Not Found

If the terminal displays an error such as:

'node' is not recognized...

Node.js may not be installed correctly or its executable may not be available in the system PATH.

Restarting the terminal after installation can also be necessary.

27. Common Setup Problem: Package Installation

If project packages are missing, run:

npm install

Then start the development server again.

Also make sure the terminal is opened inside the correct project folder.

28. Common Setup Problem: Emulator

If an Android emulator does not start, check that:

  • Android Studio is installed
  • An Android Virtual Device is configured
  • The emulator is started correctly
  • The required Android SDK components are installed
  • Your computer meets the emulator's requirements

29. Recommended Setup for This Course

For this course, students can start with the following setup:

Computer
   ↓
Node.js
   ↓
npm / npx
   ↓
VS Code
   ↓
Expo
   ↓
React Native Project
   ↓
Android Device / Emulator

As the course progresses, students will learn additional native development concepts and production build workflows.

30. Complete Setup Checklist

Before moving to the next lesson, make sure you understand the following:

  • Node.js is installed.
  • npm is available.
  • npx is available.
  • VS Code is installed.
  • You understand what Expo is.
  • You can create an Expo project.
  • You can enter the project directory.
  • You know how to install project dependencies.
  • You know how to start the Expo development server.
  • You understand the difference between a physical device and an emulator.
  • You know that native iOS development requires macOS and Xcode.
node --version
npm --version

npx create-expo-app@latest my-first-app

cd my-first-app

npm install

npx expo start

Once the development environment is ready, you can create and run your first React Native application.

📌 Key Points

  • Node.js is an important part of the React Native JavaScript tooling environment.
  • npm manages JavaScript packages used by the project.
  • npx can execute project creation and development tools.
  • VS Code can be used to write and manage React Native code.
  • Expo provides a beginner-friendly React Native development workflow.
  • An Android emulator can be used to test Android applications.
  • Android Studio provides Android SDK and emulator tools.
  • Native iOS development requires macOS and Xcode.
  • Project dependencies can be installed using npm.
  • npx expo start starts the Expo development server.

🧠 Quick Quiz

Question: Which command is used to start the Expo development server?