Behavior
bun update updates packages to the latest versions that satisfy the version ranges in package.json. The lockfile is updated to reflect the new versions.
Update all packages
package.json.
Update specific packages
Arguments
Package name
Multiple packages
Scoped packages
Flags
--latest
Update to the absolute latest version, ignoring semver ranges in package.json.
package.json with new version ranges.
--interactive (-i)
Interactively select which packages to update.
--no-save
Update packages without modifying package.json.
--cwd <path>
Run command in specified directory.
--ignore-scripts
Skip running lifecycle scripts during update.
--dry-run
Simulate update without actually installing anything.
--verbose
Enable verbose logging.
--silent
Suppress all output except errors.
Examples
Update all dependencies
Update specific package
Update to latest versions
Interactive update
Checking for outdated packages
To see which packages have available updates without installing them:Version ranges
bun update respects semver ranges in package.json:
| Range | Description | Example |
|---|---|---|
^1.2.3 | Compatible with 1.2.3 | Updates to 1.x.x |
~1.2.3 | Approximately 1.2.3 | Updates to 1.2.x |
1.2.3 | Exact version | No updates |
* | Any version | Updates to latest |
latest | Latest tag | Updates to latest |
--latest to ignore these ranges and update to the absolute latest version.
Workspaces
In workspace projects,bun update updates dependencies across all workspaces: