File: using-expo-cli.md | Updated: 11/15/2025
Hide navigation
Search
Ctrl K
Home Guides EAS Reference Learn
Archive Expo Snack Discord and Forums Newsletter
Copy page
Learn how to migrate from React Native CLI (@react-native-community/cli) to Expo CLI for any React Native project.
Copy page
To migrate from React Native CLI (npx @react-native-community/cli@latest init) to Expo CLI, you'll need to install the expo package, which includes the Expo Modules API and Expo CLI. This guide covers the installation step, the benefits of using Expo CLI, and how to compile and run your project after migrating to Expo CLI.
It is strongly recommended to use Expo CLI when using other Expo tools. It is required for many tools, such as EAS Update, Expo Router, and expo-dev-client, and other features may not work as well without it.
In most cases, executing the following command in a project directory to install the package is all you need to do:
Terminal
Copy
- npx install-expo-modules@latest
For a detailed installation guide, see Install Expo modules .
After installing the
expopackage, you'll need to configure your project to use Expo CLI. This includes setting up Metro config, Babel preset, and native project configurations. See the Configure Expo CLI for bundling on Android and iOS section for the complete setup instructions.
Why Expo CLI instead of React Native CLI
Expo CLI commands provide several benefits over the similar commands in @react-native-community/cli, which includes:
expo prebuild
for upgrades, white-labeling, easy third-party package setup, and better maintainability of the codebase (by reducing the surface area).expo-router
.
xcpretty-style tool built specifically for React Native apps. For example, when compiling a Pod, you can see which Node module included it.paths and baseUrl built-in to Metro
.expo-dev-client
, the Expo Updates protocol
and EAS Update
.pod install execution when using npx expo run:ios.npx expo install selects compatible dependency versions for well-known packages.npx expo run:[android|ios] and npx expo start. If another app is running on the default port, a different port is used.We recommend Expo CLI for most React Native projects that target Android, iOS, and/or web. It does not yet have built-in support for the most popular out-of-tree platforms, such as Windows and macOS. If building for these platforms, you can utilize Expo CLI for the supported platforms and @react-native-community/cli for the others.
After installing the expo package, you can use the following commands which are alternatives to npx react-native run-android and npx react-native run-ios:
Terminal
# for Android
- npx expo run:android
# for iOS
- npx expo run:ios
When building your project, you can choose a device or simulator by using the --device flag. This also applies to any iOS device that is connected to your computer.
Start the bundler independently
npx expo run:[android|ios] automatically starts the bundler/development server. If you want to independently start the bundler with npx expo start command, pass the --no-bundler to the npx expo run:[android|ios] command.
Can I use Expo CLI without installing the Expo Modules API?
Expo Modules API is also installed when you install the expo package with npx install-expo-modules. If you want to try out Expo CLI for now without installing Expo Modules API, install the expo package with npm install and then configure the react-native.config.js to exclude the package from autolinking:
react-native.config.js
Copy
module.exports = { dependencies: { expo: { platforms: { android: null, ios: null, macos: null, }, }, }, };
Note: Without Expo API Modules installed, certain features such as
expo-dev-clientorexpo-routerare unavailable.
Can I use prebuild for out-of-tree platforms, such as macOS or Windows?
Yes! Refer to the Customized Prebuild Example repository for more information.
Now, with the expo package installed and configured in your project, you can start using all features from Expo CLI and SDK. Here are some recommended next steps to dive deep:
Expo CLI Reference
Learn more about the commands and flags available in Expo CLI.
Customizing Metro
Learn how to customize the Metro bundler configuration for your project.
Adopt Prebuild
Automate your native directories using the app.json.
Use Expo SDK
Try out libraries from the Expo SDK in your app.
Expo Router
Expo Router brings the best routing concepts from the web to native Android and iOS apps.