bun update - BunDocumentation Index Search...⌘KInstall Bun Search...Navigation Core Commands bun updateRuntimePackage ManagerBundlerTest RunnerGuidesReferenceBlogFeedback:first-child]:!hidden peer-[.is-custom]:[&>:first-child]:sm:!hidden peer-[.is-custom]:[&>:first-child]:md:!hidden peer-[.is-custom]:[&>:first-child]:lg:!hidden peer-[.is-custom]:[&>:first-child]:xl:!hidden">Core Commandsbun installbun addbun removebun updatebunxPublishing & Analysisbun publishbun outdatedbun whybun auditbun infoWorkspace ManagementWorkspacesCatalogsbun linkbun pmAdvanced Configurationbun patchbun --filterGlobal cacheGlobal virtual storeIsolated installsLockfileLifecycle scriptsScopes and registriesOverrides and resolutionsSecurity Scanner API.npmrc support On this page--interactiveInteractive InterfaceKeyboard ControlsVisual IndicatorsPackage Grouping--recursive--latestCLI UsageUpdate StrategyDependency ScopeProject File ManagementNetwork & RegistryCachingOutput & LoggingScript ExecutionInstallation ControlsGeneral & EnvironmentCore Commandsbun update Copy pagespan]:line-clamp-1 overflow-hidden group flex items-center py-0.5 gap-1 text-sm text-gray-950/50 dark:text-white/50 group-hover:text-gray-950/70 dark:group-hover:text-white/70 rounded-none rounded-r-xl border px-3 border-gray-200 aspect-square dark:border-white/[0.07] bg-background-light dark:bg-background-dark hover:bg-gray-600/5 dark:hover:bg-gray-200/5" aria-label="More actions" type="button" id="radix-_R_n4ctdbsnlht5lebsnpfdb_" aria-haspopup="menu" aria-expanded="false" data-state="closed"> *]:[overflow-wrap:anywhere]"> Copy pagespan]:line-clamp-1 overflow-hidden group flex items-center py-0.5 gap-1 text-sm text-gray-950/50 dark:text-white/50 group-hover:text-gray-950/70 dark:group-hover:text-white/70 rounded-none rounded-r-xl border px-3 border-gray-200 aspect-square dark:border-white/[0.07] bg-background-light dark:bg-background-dark hover:bg-gray-600/5 dark:hover:bg-gray-200/5" aria-label="More actions" type="button" id="radix-_R_1cctdbsnlht5lebsnpfdb_" aria-haspopup="menu" aria-expanded="false" data-state="closed"> To upgrade your Bun CLI version, see bun upgrade.
To update all dependencies to the latest version:
terminal Yes NoSuggest editsRaise issuebun removePreviousbunxNext⌘I xgithubdiscordyoutubePowered byThis documentation is built and hosted on Mintlify, a developer documentation platform
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Skip to main contentBun home pageUpdate dependencies to latest versions
bun updateTo update a specific dependency to the latest version: terminal
bun update [package]--interactive For a more controlled update experience, use the --interactive flag to select which packages to update: terminal
bun update --interactive bun update -iThis launches an interactive terminal interface that shows all outdated packages with their current and target versions. You can then select which packages to update. 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 suffix like dev, peer, optional for clarity) 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 additional suffixes ( dev, peer, optional) for extra clarity. --recursive Use the --recursive flag with --interactive to update dependencies across all workspaces in a monorepo: terminal
bun update --interactive --recursive bun update -i -rThis displays an additional “Workspace” column showing which workspace each dependency belongs to. --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: terminal
bun update --latestIn interactive mode, you can toggle individual packages between their target version (respecting semver) and latest version using the l key. For example, with the following package.json: 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
terminalbun update package> version>Update Strategy --forcebooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Always request the latest versions from the registry & reinstall all dependencies. Alias: -f --latestbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Update packages to their latest versions Dependency Scope --productionbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Don’t install devDependencies. Alias: -p --globalbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Install globally. Alias: -g --omitstringp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Exclude dev, optional, or peer dependencies from install Project File Management --yarnbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Write a yarn.lock file (yarn v1). Alias: -y --no-savebooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Don’t update package.json or save a lockfile --savebooleandefault:"true"p:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Save to package.json (true by default) --frozen-lockfilebooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Disallow changes to lockfile --save-text-lockfilebooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Save a text-based lockfile --lockfile-onlybooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Generate a lockfile without installing dependencies Network & Registry --castringp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Provide a Certificate Authority signing certificate --cafilestringp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Same as —ca, but as a file path to the certificate --registrystringp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables --network-concurrencynumberdefault:"48"p:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Maximum number of concurrent network requests (default 48) Caching --cache-dirstringp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Store & load cached data from a specific directory path --no-cachebooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Ignore manifest cache entirely Output & Logging --silentbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Don’t log anything --verbosebooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Excessively verbose logging --no-progressbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Disable the progress bar --no-summarybooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Don’t print a summary Script Execution --ignore-scriptsbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Skip lifecycle scripts in the project’s package.json (dependency scripts are never run) --concurrent-scriptsnumberdefault:"5"p:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Maximum number of concurrent jobs for lifecycle scripts (default 5) Installation Controls --no-verifybooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Skip verifying integrity of newly downloaded packages --trustbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Add to trustedDependencies in the project’s package.json and install the package(s) --backendstringdefault:"clonefile"p:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Platform-specific optimizations for installing dependencies. Possible values: clonefile (default), hardlink, symlink, copyfile General & Environment --configstringp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Specify path to config file (bunfig.toml). Alias: -c --dry-runbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Don’t install anything --cwdstringp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Set a specific cwd --helpbooleanp:first-child]:mt-0 [&_.prose>p:last-child]:mb-0" data-component-part="field-content">Print this help menu. Alias: -h
Was this page helpful?
bun update - Bun,AI智能索引,全网链接索引,智能导航,网页索引
- Update dependencies to latest versions