expo-version
v1.0.2
Published
Version management tool for Expo React Native apps, similar to npm version but for expo apps
Maintainers
Readme
expo-version
Version management tool for Expo React Native apps, similar to npm version but designed specifically for Expo projects.

Use Case
Problem: When using EAS Build, you need to manually update the version in app.json before triggering a build. This manual process is error-prone and breaks your development flow.
Solution: expo-version integrates seamlessly into your build workflow by prompting for version updates before builds, ensuring your app version is always up-to-date.
Typical Workflow Integration
{
"scripts": {
"build:ios": "expo-version && eas build --platform ios",
"build:android": "expo-version && eas build --platform android",
"build:all": "expo-version && eas build --platform all"
}
}Now when you run npm run build:ios, it will:
- 🔍 Show your current version from
app.json - 🎯 Prompt you to select the new version (keep current/patch/minor/major/custom)
- 📝 Update both
app.jsonandpackage.json(if version changed) - 📦 Commit and tag the version change (if version changed)
- 🚀 Trigger the EAS build with the correct version
Result: No more forgetting to update versions, no more builds with wrong version numbers, and a clean git history of your releases.
Features
- 📱 Expo-specific: Reads and updates versions in both
app.jsonandpackage.json - 🎯 Interactive: Prompts for version increments (patch, minor, major) or custom versions
- 🔧 Git integration: Automatically creates commits and tags
- 🚀 EAS compatible: Works seamlessly with EAS Build lifecycle hooks
- 🛡️ TypeScript: Fully typed with TypeScript support
- 📦 Semver compliant: Uses semantic versioning standards
Installation
npm install -g expo-versionOr use it directly with npx:
npx expo-versionUsage
Interactive mode
Simply run the command and select your preferred version increment:
expo-versionThis will:
- Show the current version from
app.json - Prompt you to select from these options:
- keep current - Keep the existing version (useful for rebuilds)
- patch - Increment patch version (e.g., 1.2.3 → 1.2.4)
- minor - Increment minor version (e.g., 1.2.3 → 1.3.0)
- major - Increment major version (e.g., 1.2.3 → 2.0.0)
- custom - Enter a custom version
- Update both
app.jsonandpackage.json(if version changed) - Create a git commit and tag (if in a git repository and version changed)
Direct version specification
Specify the exact version you want:
expo-version 1.2.3Skip git tagging
Use the --no-git-tag-version flag to prevent git tag creation:
expo-version 1.2.3 --no-git-tag-versionOptions
| Option | Description |
| ---------------------- | ------------------------------------------------- |
| --no-git-tag-version | Prevent git tag creation (similar to npm version) |
| --help, -h | Show help message |
Requirements
- Node.js 16 or higher
- An Expo project with
app.jsoncontainingexpo.versionfield package.jsonfile
EAS Build Integration
This tool is designed to work with EAS Build lifecycle hooks. You can use it in your package.json scripts:
{
"scripts": {
"eas-build-pre-install": "expo-version --no-git-tag-version",
"version": "expo-version"
}
}Git Workflow
When run in a git repository, expo-version will:
- Check for uncommitted changes (prompts for confirmation if found)
- Update
app.jsonandpackage.jsonwith the new version - Add both files to git staging area
- Create a commit with message
v{version}(e.g.,v1.2.3) - Create a git tag
v{version}(unless--no-git-tag-versionis used)
Programmatic Usage
You can also use expo-version programmatically in your Node.js scripts:
import { ExpoVersion } from "expo-version";
const expoVersion = new ExpoVersion("/path/to/project", {
noGitTagVersion: true,
});
await expoVersion.run("1.2.3");Examples
Basic usage
# Interactive version selection:
# ❯ keep current (1.2.3)
# patch (1.2.4)
# minor (1.3.0)
# major (2.0.0)
# custom
expo-version
# Set specific version
expo-version 2.1.0
# Update version without creating git tag
expo-version 2.1.0 --no-git-tag-versionEAS Build integration
{
"name": "my-expo-app",
"scripts": {
"build:ios": "expo-version && eas build --platform ios",
"build:android": "expo-version && eas build --platform android",
"build:all": "expo-version && eas build --platform all",
"eas-build-pre-install": "expo-version --no-git-tag-version"
}
}Error Handling
expo-version will exit with appropriate error messages if:
app.jsonis not found or doesn't containexpo.versionpackage.jsonis not found- Invalid semver format is provided
- Git operations fail
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
