Bun

bun update

To update all dependencies to the latest version:

bun update

To update a specific dependency to the latest version:

bun update [package]

--latest

By default, bun update will update to the latest version of a dependency that satisfies the version range specified in your package.json.

To update to the latest version, regardless of if it's compatible with the current version range, use the --latest flag:

bun update --latest

For example, with the following package.json:

{
  "dependencies": {
    "react": "^17.0.2"
  }
}
  • bun update would update to a version that matches 17.x.
  • bun update --latest would update to a version that matches 18.x or later.

CLI Usage

$bun update <name>@<version>

Flags

General Configuration

-c,--config=<val>
Specify path to config file (bunfig.toml)
-g,--global
Install globally
--cwd=<val>
Set a specific cwd

Lockfile Management

-y,--yarn
Write a yarn.lock file (yarn v1)
--no-save
Don't update package.json or save a lockfile
--save
Save to package.json (true by default)
--frozen-lockfile
Disallow changes to lockfile
--save-text-lockfile
Save a text-based lockfile
--lockfile-only
Generate a lockfile without installing dependencies

Dependency Management

-p,--production
Don't install devDependencies
-f,--force
Always request the latest versions from the registry & reinstall all dependencies
--ignore-scripts
Skip lifecycle scripts in the project's package.json (dependency scripts are never run)
--trust
Add to trustedDependencies in the project's package.json and install the package(s)
--omit=<val>
Exclude 'dev', 'optional', or 'peer' dependencies from install
--latest
Update packages to their latest versions

Caching and Performance

--cache-dir=<val>
Store & load cached data from a specific directory path
--no-cache
Ignore manifest cache entirely
--concurrent-scripts=<val>
Maximum number of concurrent jobs for lifecycle scripts (default 5)
--network-concurrency=<val>
Maximum number of concurrent network requests (default 48)

Registry and Authentication

--ca=<val>
Provide a Certificate Authority signing certificate
--cafile=<val>
The same as `--ca`, but is a file path to the certificate
--registry=<val>
Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables

Output and Logging

--silent
Don't log anything
--verbose
Excessively verbose logging
--no-progress
Disable the progress bar
--no-summary
Don't print a summary

Verification and Integrity

--no-verify
Skip verifying integrity of newly downloaded packages

Miscellaneous

--dry-run
Don't install anything
--backend=<val>
Platform-specific optimizations for installing dependencies. Possible values: "clonefile" (default), "hardlink", "symlink", "copyfile"
-h,--help
Print this help menu

Examples

Update all dependencies:
bun update
Update all dependencies to latest:
bun update --latest
Update specific packages:
bun update zod jquery@3
Full documentation is available at https://bun.sh/docs/cli/update