update command helps you keep all Refine packages up to date by interactively selecting which packages to update and to which version.
Usage
Options
Select which version to update packages to.Choices:
latest, nextDefault: Version ranges in package.json will be installedUpdate all Refine packages to the selected tag without interactive prompts. If tag is not provided, version ranges in
package.json will be installed.Get the installation command for outdated packages without automatically updating. Useful for reviewing changes before applying them.
How It Works
Theupdate command:
- Checks all installed
@refinedev/*packages - Compares current versions with available versions
- Displays a table of available updates
- Prompts for update strategy (or uses provided options)
- Updates
package.jsonwith new versions - 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:Output
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:Update to Wanted Versions
Update to versions that satisfy yourpackage.json semver ranges:
Update to Latest Versions
Update all packages to the absolute latest versions (may include breaking changes):Update to Next (Beta) Versions
Try pre-release versions:Preview Update Command
See what would be updated without making changes:Output
Interactive Mode for Major Updates
For major version updates with breaking changes, use interactive mode:Update Strategies
Minor Updates (Recommended)
Safe updates with no breaking changes:- Updates to latest patch and minor versions
- No breaking changes
- Safe for production
Wanted Updates
Respect yourpackage.json version ranges:
package.json has:
4.x.x version.
Latest Updates
Get the absolute latest versions:- May include breaking changes
- Review changelog before updating
- Test thoroughly after updating
Package Manager Support
The update command works with all package managers:Best Practices
1. Check Updates Regularly
Run weekly or before starting new features:2. Use Dry Run First
Preview changes before applying:3. Update Minor Versions Frequently
Stay current with bug fixes and improvements:4. Test After Major Updates
After updating to latest versions:5. Review Changelogs
Before major updates, check:- Refine Changelog
- Breaking changes documentation
- Migration guides
CI/CD Integration
Automated Dependency Updates
Create a GitHub Action to check for updates:.github/workflows/update-dependencies.yml
Pre-deployment Checks
Troubleshooting
No Updates Available
If all packages are up to date:Output
Conflicting Dependencies
If you see dependency conflicts:-
Clear node_modules and lock file:
- Try updating one package at a time in interactive mode
Update Fails
If installation fails after update:-
Revert
package.jsonchanges: -
Update packages individually:
Breaking Changes After Update
If your app breaks after updating:- Check the migration guide
- Review breaking changes in changelogs
- Revert to previous versions if needed:
Version Compatibility
Ensure compatible versions across packages:@refinedev/coreshould 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