DEV Community

Cover image for How I did the setup for my mobile app project (ReactNative & Expo)
royson menezes
royson menezes

Posted on • Edited on

4 2 2 2 2

How I did the setup for my mobile app project (ReactNative & Expo)

Recently, I started working on a project to develop a mobile application using React Native and Expo. Since I already have some experience with these technologies, I preferred them over Flutter and Dart.

In this guide, I'll walk you through the setup process, the tools required, and some common errors I encountered along the way.

Prerequisites:
Before getting started, ensure you have the following installed:

  1. Node.js & NVM (Node Version Manager)

Download and install Node.js from the official website. To manage multiple Node.js versions, install NVM (useful for switching versions).
Verify the installations

```shell
node -v    # Check Node.js version  
nvm -v     # Check NVM version  
```
Enter fullscreen mode Exit fullscreen mode
  1. Git (Optional, but Recommended)

Install Git for version control and collaboration.
Useful for pushing code to platforms like GitHub or GitLab.

Setup process

Step 1: Create a New Expo Project

To create a new Expo project, run the following command and also install the required packages inside the project directory.

npx create-expo-app MyReactNativeApp     #to create project
cd MyReactNativeApp    # get into project folder
npm install       # to install dependencies for the project
Enter fullscreen mode Exit fullscreen mode

This command will generate the project directory structure and essential files like App.js and installs required packages.

Step 2: Install Expo CLI Tools (optional)
Navigate to your project directory and install Expo:

npm install expo
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

expo -v # Check Expo version  
Enter fullscreen mode Exit fullscreen mode

Step 3: Start the Project and Run It
To start your project, use:

expo start
Enter fullscreen mode Exit fullscreen mode

or

npx expo start
Enter fullscreen mode Exit fullscreen mode

This will launch Expo’s development server, allowing you to test your app on a physical device (via the Expo Go app) or an emulator.

Understanding difference with npm ,npx nvm, node etc.

Term Definition
Node.js It's not a new programming language or framework—it’s simply the runtime environment that lets you run JavaScript on any machine, whether it’s a server, desktop, or even an embedded system.
NPM (Node Package Manager) This is your go-to tool bundled with Node.js for installing and managing JavaScript packages, making it one of the largest software repositories available.
NPX Similar to NPM, NPX comes bundled with it, but instead of just installing packages, it lets you execute them directly without needing a global install.
NVM (Node Version Manager) A handy tool that allows you to switch between different versions of Node.js easily, helping you manage compatibility without any hassle.

Errors I Encountered:

  1. NVM Setup:
    I experienced issues during the NVM setup due to a conflict with another version manager called Volta. If you run into similar problems, check whether Volta is interfering with your NVM installation. Alternatively, if you prefer, you can opt to use Volta instead.

  2. Node.js Installation Issues:
    I also encountered problems installing Node.js, which were linked to an incorrect NVM configuration. Make sure that NVM is properly set up in your environment variables—for example, ensure that your PATH includes the correct NVM directories. This setup is crucial for a smooth Node.js installation.

I hope this guide helps you kickstart your React Native journey. Follow for more tips, tutorials, and updates on mobile app development!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (1)

Collapse
 
sheba_fernandes_425dd96bb profile image
Sheba Fernandes

Amazing Royson

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay