Skip to main content

Checking for outdated packages

Use bun outdated to see which installed packages have newer versions available:
The output shows the current, wanted (within semver range), and latest versions for each outdated package:

Updating packages

Update all packages

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

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.
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:
The interface shows packages grouped by dependency type with their current, target, and latest versions:
Keyboard controls: 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:
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:
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:
Add --all to include transitive dependencies: