bun update
Update dependencies to latest versions
bun upgrade.To update all dependencies to the latest version:
bun updateTo update a specific dependency to the latest version:
bun update [package]--interactive
Use the --interactive flag to choose which packages to update:
bun update --interactive
bun update -iThe flag opens a terminal interface that lists every outdated package with its current and target versions.
Interactive Interface
The interface displays packages grouped by dependency type:
? Select packages to update - Space to toggle, Enter to confirm, a to select all, n to select none, i to invert, l to toggle latest
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
optionalDependencies Current Target Latest
□ some-optional-package 1.0.0 1.1.0 1.2.0Sections:
- Packages are grouped under section headers:
dependencies,devDependencies,peerDependencies,optionalDependencies - Each section shows column headers aligned with the package data
Columns:
- Package: Package name (may have a suffix such as
dev,peer, oroptional) - Current: Currently installed version
- Target: Version that would be installed (respects semver constraints)
- Latest: Latest available version
Keyboard Controls
Selection:
- Space: Toggle package selection
- Enter: Confirm selections and update
- a/A: Select all packages
- n/N: Select none
- i/I: Invert selection
Navigation:
- ↑/↓ Arrow keys or j/k: Move cursor
- l/L: Toggle between target and latest version for current package
Exit:
- Ctrl+C or Ctrl+D: Cancel without updating
Visual Indicators
- ■ Selected packages (will be updated)
- □ Unselected packages
- ❯ Current cursor position
- Colors: Red (major), yellow (minor), green (patch) version changes
- Underlined: Currently selected update target
Package Grouping
Packages are organized in sections by dependency type:
- dependencies - Regular runtime dependencies
- devDependencies - Development dependencies
- peerDependencies - Peer dependencies
- optionalDependencies - Optional dependencies
Within each section, individual packages may have a suffix ( dev, peer, optional).
--recursive
Use the --recursive flag with --interactive to update dependencies across all workspaces in a monorepo:
bun update --interactive --recursive
bun update -i -rWith --recursive, the interface adds a “Workspace” column showing which workspace each dependency belongs to.
--latest
By default, bun update updates each dependency to the latest version that satisfies the version range in your package.json.
To update to the latest version regardless of whether it satisfies that range, use the --latest flag:
bun update --latestIn interactive mode, press l to toggle a package between its target version (respecting semver) and the latest version.
For example, with the following package.json:
{
"dependencies": {
"react": "^17.0.2"
}
}bun updatewould update to a version that matches17.x.bun update --latestwould update to a version that matches18.xor later.
CLI Usage
bun update <name>@<version>Update Strategy
--forcebooleanAlways request the latest versions from the registry & reinstall all dependencies. Alias: -f
--latestbooleanUpdate packages to their latest versions
Dependency Scope
--productionbooleanDon’t install devDependencies. Alias: -p
--globalbooleanInstall globally. Alias: -g
--omitstringExclude dev, optional, or peer dependencies from install
Project File Management
--yarnbooleanWrite a yarn.lock file (yarn v1). Alias: -y
--no-savebooleanDon’t update package.json or save a lockfile
--savebooleandefault: trueSave to package.json (true by default)
--frozen-lockfilebooleanDisallow changes to lockfile
--save-text-lockfilebooleanSave a text-based lockfile
--lockfile-onlybooleanGenerate a lockfile without installing dependencies
Network & Registry
--castringProvide a Certificate Authority signing certificate
--cafilestringSame as --ca, but as a file path to the certificate
--registrystringUse a specific registry by default, overriding .npmrc, bunfig.toml and environment variables
--network-concurrencynumberdefault: 48Maximum number of concurrent network requests (default 48)
Caching
--cache-dirstringStore & load cached data from a specific directory path
--no-cachebooleanIgnore manifest cache entirely
Output & Logging
--silentbooleanDon’t log anything
--verbosebooleanExcessively verbose logging
--no-progressbooleanDisable the progress bar
--no-summarybooleanDon’t print a summary
Script Execution
--ignore-scriptsbooleanSkip lifecycle scripts in the project’s package.json (dependency scripts are never run)
--concurrent-scriptsnumberMaximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
Installation Controls
--no-verifybooleanSkip verifying integrity of newly downloaded packages
--trustbooleanAdd to trustedDependencies in the project’s package.json and install the package(s)
--backendstringdefault: clonefilePlatform-specific optimizations for installing dependencies. Possible values: clonefile (default),
hardlink, symlink, copyfile
General & Environment
--configstringSpecify path to config file (bunfig.toml). Alias: -c
--dry-runbooleanDon’t install anything
--cwdstringSet a specific cwd
--helpbooleanPrint this help menu. Alias: -h