DEV Community

Cover image for Setting Up a React Native Expo Project with Yarn
Priyanxhu
Priyanxhu

Posted on

Setting Up a React Native Expo Project with Yarn

Learn how to create and set up a React Native project using Expo and Yarn package manager

Setting Up a React Native Expo Project with Yarn

Prerequisites

  • Node.js installed
  • Yarn package manager installed
  • Expo CLI

Installation Steps

  1. Install Expo CLI globally using Yarn:
yarn global add expo-cli
Enter fullscreen mode Exit fullscreen mode
  1. Create a new Expo project:
expo init my-expo-app
Enter fullscreen mode Exit fullscreen mode
  1. Navigate to project directory:
cd my-expo-app
Enter fullscreen mode Exit fullscreen mode
  1. Install dependencies with Yarn:
yarn install
Enter fullscreen mode Exit fullscreen mode

Running the Project

Start the development server:

yarn start
Enter fullscreen mode Exit fullscreen mode

Common Scripts

  • yarn start: Starts the development server
  • yarn android: Runs app on Android emulator
  • yarn ios: Runs app on iOS simulator
  • yarn web: Runs app in web browser
  • yarn test: Runs tests
  • yarn eject: Ejects from Expo

Additional Dependencies

To add new packages:

yarn add package-name
Enter fullscreen mode Exit fullscreen mode

Tips

  • Use yarn.lock for consistent dependencies
  • Keep Expo SDK updated
  • Check app.json for configuration

Happy coding! ๐Ÿš€

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post