Skip to main content
Update dependencies to their latest versions.
bun update

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

bun update
Updates all dependencies in package.json.

Update specific packages

bun update <package>
Updates only the specified package(s).

Arguments

Package name

bun update react

Multiple packages

bun update react react-dom typescript

Scoped packages

bun update @types/node

Flags

--latest

Update to the absolute latest version, ignoring semver ranges in package.json.
bun update --latest
This updates all packages to their latest versions and modifies package.json with new version ranges.
# Update specific packages to latest
bun update --latest react react-dom

--interactive (-i)

Interactively select which packages to update.
bun update --interactive
Displays an interactive prompt:
? Select packages to update:
  ◯ react (18.2.0 → 18.3.0)
  ◉ typescript (5.0.0 → 5.3.0)
  ◯ @types/node (20.0.0 → 20.10.0)

--no-save

Update packages without modifying package.json.
bun update --no-save

--cwd <path>

Run command in specified directory.
bun update --cwd ./my-project

--ignore-scripts

Skip running lifecycle scripts during update.
bun update --ignore-scripts

--dry-run

Simulate update without actually installing anything.
bun update --dry-run
Shows what would be updated:
$ bun update --dry-run

[dry-run] Would update:
  react: 18.2.0 → 18.3.0
  typescript: 5.0.0 → 5.3.0

--verbose

Enable verbose logging.
bun update --verbose

--silent

Suppress all output except errors.
bun update --silent

Examples

Update all dependencies

$ bun update
bun update v1.0.0

 Updated react: 18.2.0 18.2.1
 Updated typescript: 5.0.0 5.0.4

 2 packages updated [534ms]

Update specific package

$ bun update react
bun update v1.0.0

 Updated react: 18.2.0 18.2.1

 1 package updated [287ms]

Update to latest versions

$ bun update --latest
bun update v1.0.0

 Updated react: 18.2.0 19.0.0
 Updated typescript: 5.0.0 5.3.3

 package.json updated
 2 packages updated [621ms]

Interactive update

$ bun update --interactive
bun update v1.0.0

? Select packages to update:
 react (18.2.0  18.3.0)
 typescript (5.0.0  5.3.0)
 @types/node (20.0.0  20.10.0)

 2 packages updated [445ms]

Checking for outdated packages

To see which packages have available updates without installing them:
bun outdated
See bun outdated for details.

Version ranges

bun update respects semver ranges in package.json:
RangeDescriptionExample
^1.2.3Compatible with 1.2.3Updates to 1.x.x
~1.2.3Approximately 1.2.3Updates to 1.2.x
1.2.3Exact versionNo updates
*Any versionUpdates to latest
latestLatest tagUpdates to latest
Use --latest to ignore these ranges and update to the absolute latest version.

Workspaces

In workspace projects, bun update updates dependencies across all workspaces:
bun update
Update dependencies in a specific workspace:
bun update --cwd packages/frontend react

Aliases

These commands are equivalent:
bun update
bun upgrade

Build docs developers (and LLMs) love