Skip to main content
The update command helps you keep all Refine packages up to date by interactively selecting which packages to update and to which version.

Usage

refine update [options]

Options

-t, --tag <tag>
string
default:"wanted"
Select which version to update packages to.Choices: latest, nextDefault: Version ranges in package.json will be installed
refine update --tag latest
-a, --all
boolean
default:"false"
Update all Refine packages to the selected tag without interactive prompts. If tag is not provided, version ranges in package.json will be installed.
refine update --all
-d, --dry-run
boolean
default:"false"
Get the installation command for outdated packages without automatically updating. Useful for reviewing changes before applying them.
refine update --dry-run

How It Works

The update command:
  1. Checks all installed @refinedev/* packages
  2. Compares current versions with available versions
  3. Displays a table of available updates
  4. Prompts for update strategy (or uses provided options)
  5. Updates package.json with new versions
  6. Runs package installation

Version Types

The update command shows three version types:
  • Current - The version currently installed in your project
  • Wanted - The maximum version that satisfies the semver range in package.json
  • Latest - The latest stable version available on npm

Examples

Interactive Update

Run the update command to see available updates:
refine update
Output
┌─────────────────────────────────────────────────────────────────┐
                      Available Updates
├──────────────────────────┬─────────┬─────────┬──────────────────┤
 Package Current Wanted Latest
├──────────────────────────┼─────────┼─────────┼──────────────────┤
 @refinedev/core 4.45.0 4.45.2 4.46.0
 @refinedev/antd 5.35.0 5.35.2 5.36.0
 @refinedev/react-router 4.15.0 4.15.1 4.16.0
└──────────────────────────┴─────────┴─────────┴──────────────────┘

- Current: The version of the package that is currently installed
- Wanted: The maximum version of the package that satisfies the semver range specified in `package.json`
- Latest: The latest version of the package available on npm

? Do you want to update all Refine packages for minor and patch versions?
 Update all packages to latest "minor" version without any breaking changes.
    Update all packages to the latest version that satisfies the semver(`wanted`) range specified in `package.json`
    Use interactive mode. Choose this option for "major" version updates.

Update to Latest Minor Versions

Update all packages to the latest minor version (safe updates, no breaking changes): Select “Update all packages to latest ‘minor’ version” in the interactive prompt, or:
refine update --all

Update to Wanted Versions

Update to versions that satisfy your package.json semver ranges:
refine update --all --tag wanted

Update to Latest Versions

Update all packages to the absolute latest versions (may include breaking changes):
refine update --all --tag latest

Update to Next (Beta) Versions

Try pre-release versions:
refine update --all --tag next

Preview Update Command

See what would be updated without making changes:
refine update --dry-run
Output
pnpm add @refinedev/core@^4.46.0 @refinedev/antd@^5.36.0 @refinedev/react-router@^4.16.0

Interactive Mode for Major Updates

For major version updates with breaking changes, use interactive mode:
refine update
Then select “Use interactive mode” and choose which packages to update individually.

Update Strategies

Safe updates with no breaking changes:
refine update --all
  • Updates to latest patch and minor versions
  • No breaking changes
  • Safe for production

Wanted Updates

Respect your package.json version ranges:
refine update --all --tag wanted
If your package.json has:
"@refinedev/core": "^4.45.0"
This will update to the latest 4.x.x version.

Latest Updates

Get the absolute latest versions:
refine update --all --tag latest
  • May include breaking changes
  • Review changelog before updating
  • Test thoroughly after updating

Package Manager Support

The update command works with all package managers:
refine update
It automatically detects your package manager and uses the appropriate commands.

Best Practices

1. Check Updates Regularly

Run weekly or before starting new features:
refine update

2. Use Dry Run First

Preview changes before applying:
refine update --dry-run

3. Update Minor Versions Frequently

Stay current with bug fixes and improvements:
refine update --all

4. Test After Major Updates

After updating to latest versions:
refine update --all --tag latest
npm run test
npm run build

5. Review Changelogs

Before major updates, check:

CI/CD Integration

Automated Dependency Updates

Create a GitHub Action to check for updates:
.github/workflows/update-dependencies.yml
name: Update Dependencies

on:
  schedule:
    - cron: '0 0 * * 1' # Weekly on Monday
  workflow_dispatch:

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '20'
      - run: npm ci
      - run: npx refine update --all --dry-run

Pre-deployment Checks

# In your CI pipeline
refine update --dry-run
if [ $? -eq 0 ]; then
  echo "✓ All Refine packages are up to date"
else
  echo "⚠ Updates available - run 'refine update'"
fi

Troubleshooting

No Updates Available

If all packages are up to date:
Output
All `Refine` packages are up to date 🎉

Conflicting Dependencies

If you see dependency conflicts:
  1. Clear node_modules and lock file:
    rm -rf node_modules package-lock.json
    npm install
    
  2. Try updating one package at a time in interactive mode

Update Fails

If installation fails after update:
  1. Revert package.json changes:
    git checkout package.json
    npm install
    
  2. Update packages individually:
    npm install @refinedev/core@latest
    

Breaking Changes After Update

If your app breaks after updating:
  1. Check the migration guide
  2. Review breaking changes in changelogs
  3. Revert to previous versions if needed:
    git checkout package.json package-lock.json
    npm install
    

Version Compatibility

Ensure compatible versions across packages:
  • @refinedev/core should be on the same major version as UI packages
  • Router packages should match your routing library version
  • Data providers should be compatible with your backend

Next Steps

Build docs developers (and LLMs) love