@expo/cli npm package. There are two primary ways to use it: via npx (recommended) or as a global installation.
npx (Recommended)
The recommended way to use Expo CLI is withnpx, which runs the CLI without installing it globally:
Benefits of npx
- Always uses the correct version for your project
- No global installation required
- Automatically updates when you run commands
- Works seamlessly in CI/CD environments
- Avoids version conflicts between projects
How it Works
When you runnpx expo, it:
- Checks if
expois installed in your project’snode_modules - Downloads and caches the latest version if not found
- Executes the command with the appropriate version
Global Installation
You can install Expo CLI globally if you prefer to have it available system-wide:npx:
Considerations for Global Installation
- You may need to manually update the CLI to get new features
- Different projects might need different CLI versions
- Can cause conflicts if projects expect specific versions
- Requires administrative permissions on some systems
Project-Level Installation
Expo CLI is typically included as a dependency when you create a new Expo project. You can also add it manually:Version Management
Checking Your Version
Upgrading Expo CLI
When usingnpx, you automatically get the latest version. For global installations:
Pinning to a Specific Version
If you need a specific version for compatibility:package.json:
Verifying Installation
After installation, verify that Expo CLI is working:Node.js Requirements
Expo CLI requires Node.js version 20.19.4 or newer. Check your Node.js version:Using Version Managers
We recommend using a Node.js version manager likenvm or fnm:
Troubleshooting
Command Not Found
If you get “command not found” errors:- Ensure Node.js and npm are installed
- Check that your PATH includes npm global binaries
- Try closing and reopening your terminal
- Use
npx expoinstead ofexpo
Permission Errors
On macOS/Linux, if you get permission errors with global installation:Version Conflicts
If you have multiple versions installed:CI/CD Environments
For continuous integration, always usenpx or install as a dev dependency: