Skip to main content

Checking for outdated packages

Use bun outdated to see which installed packages have newer versions available:
bun outdated
The output shows the current, wanted (within semver range), and latest versions for each outdated package:
Package       Current  Update   Latest
react         17.0.2   17.0.2   18.3.1
typescript    4.9.5    4.9.5    5.3.3
lodash        4.17.20  4.17.21  4.17.21

Updating packages

Update all packages

bun update
By default, bun update updates each package to the latest version that satisfies the version range in package.json. The package.json ranges themselves are not modified. For example, if package.json specifies "react": "^17.0.2", running bun update installs the latest 17.x release but does not upgrade to 18.x.

Update a specific package

bun update react
bun update typescript eslint

Update beyond semver constraints

Use --latest to update to the absolute latest version, ignoring your package.json version ranges. This may include major version bumps.
bun update --latest
bun update react --latest
package.json version ranges are rewritten to the new version.

Interactive update

Use --interactive (or -i) for a terminal UI that lets you select exactly which packages to update:
bun update --interactive
bun update -i
The interface shows packages grouped by dependency type with their current, target, and latest versions:
? Select packages to update - Space to toggle, Enter to confirm

  dependencies            Current  Target   Latest
    □ react               17.0.2   18.2.0   18.3.1
    □ lodash              4.17.20  4.17.21  4.17.21

  devDependencies         Current  Target   Latest
    □ typescript          4.8.0    5.0.0    5.3.3
    □ @types/node         16.11.7  18.0.0   20.11.5
Keyboard controls:
KeyAction
SpaceToggle selection
EnterConfirm and update selected packages
aSelect all
nSelect none
iInvert selection
lToggle between target and latest version for the current package
/ Move cursor
Ctrl+CCancel without updating
Version changes are color-coded: red for major, yellow for minor, green for patch.

Interactive update across workspaces

Use --recursive with --interactive to update dependencies across all workspaces in a monorepo:
bun update --interactive --recursive
bun update -i -r
An additional “Workspace” column shows which workspace each dependency belongs to.

Why is a package installed?

Use bun pm why to understand why a package appears in node_modules:
bun pm why lodash
This traces the dependency chain from your root package.json to the package, showing which packages depend on it.

Listing installed packages

Use bun pm ls to list all installed dependencies and their resolved versions:
bun pm ls
Add --all to include transitive dependencies:
bun pm ls --all

Build docs developers (and LLMs) love