Skip to main content
The expo install command installs npm packages with versions that are compatible with your Expo SDK version. It ensures that all installed packages work together correctly.

Usage

The command is also aliased as expo add:

Arguments

string[]
One or more package names to install. Separate multiple packages with spaces.

Options

boolean
Check which installed packages need to be updated. Shows packages with incompatible versions.
boolean
Automatically update any invalid package versions to compatible versions.
boolean
Save the dependencies as devDependencies instead of dependencies.
boolean
Use npm to install dependencies. Default when package-lock.json exists.
boolean
Use Yarn to install dependencies. Default when yarn.lock exists.
boolean
Use pnpm to install dependencies. Default when pnpm-lock.yaml exists.
boolean
Use bun to install dependencies. Default when bun.lock or bun.lockb exists.
boolean
Output dependency information in JSON format. Use with --check flag.

Why Use expo install?

Version Compatibility

Expo SDK versions require specific versions of certain packages. Using expo install ensures you get compatible versions automatically. For example, if you’re on Expo SDK 51:
  • react-native must be version 0.74.x
  • react must be version 18.2.0
  • react-dom must be version 18.2.0
Running expo install react-native installs the correct version for your SDK.

How It Differs from npm/yarn/pnpm

Examples

Install Single Package

Install a package with compatible version:

Install Multiple Packages

Install several packages at once:

Install as Dev Dependencies

Install packages as devDependencies:

Check for Updates

Check which packages need updating:
Output example:

Fix Incompatible Versions

Automatically update incompatible packages:
This updates all packages to their SDK-compatible versions.

JSON Output

Get machine-readable output:
Useful for CI/CD scripts and automation.

Specify Package Manager

Use a specific package manager:

Pass Additional Arguments

Pass arguments to the underlying package manager:
This runs:
Or with npm:

Common Use Cases

After Upgrading Expo SDK

After upgrading to a new SDK version, fix all dependencies:

Adding New Features

When adding packages with native code:
This ensures the version works with your current SDK.

Setting Up New Project

Install common dependencies:

Development Dependencies

Add TypeScript and types:

Package Manager Detection

Expo CLI automatically detects your package manager based on lock files: You can override this with the package manager flags.

Version Resolution

How Versions Are Determined

  1. Check SDK Version - Reads expo package version
  2. Query API - Fetches compatible versions from Expo API
  3. Resolve Version - Determines the correct version for each package
  4. Install - Runs package manager with resolved versions

Expo Packages

For packages in the expo-* namespace:
  • Version matches your Expo SDK (e.g., SDK 51 → expo-camera 15.0.x)
  • Always compatible with your SDK

Third-Party Packages

For packages like react-native-*:
  • Versions are tested and verified by Expo
  • May differ from the latest npm version
  • Guaranteed to work with your SDK

Latest Versions

For packages without SDK requirements:
  • Installs the latest version from npm
  • Same behavior as npm install

Checking Compatibility

Before Installation

Check if a package is compatible:

After Installation

Verify all packages are compatible:

In CI/CD

Add a check step to your pipeline:
Exit code will be non-zero if packages are incompatible.

Troubleshooting

Peer Dependency Warnings

Expo install resolves peer dependencies automatically. If you see warnings:

Version Conflicts

If manual version is specified in package.json:
expo install --fix will update to the compatible version.

Package Not Found

If a package isn’t in the Expo compatibility list:
  • It will install the latest version from npm
  • May require manual version management
  • Check package documentation for React Native compatibility

Network Issues

If the API request fails:
  • Falls back to latest versions
  • Use --npm with specific version: npm install package@version
  • Check internet connection

Best Practices

Always Use expo install for Expo Packages

Use for React Native Core Packages

Check Before Upgrading SDK

In Version Control

Commit lock files to ensure consistency:
  • package-lock.json (npm)
  • yarn.lock (yarn)
  • pnpm-lock.yaml (pnpm)
  • bun.lockb (bun)

CI/CD Integration

GitHub Actions Example

Pre-commit Hook

Add to .husky/pre-commit:

Additional Resources

  • Compatible versions are maintained in the Expo SDK reference
  • Version API endpoint: https://exp.host/--/api/v2/versions
  • Report compatibility issues on GitHub