LinuxCommandLibrary

bun-upgrade

Upgrade the Bun runtime

TLDR

Upgrade to the latest stable version

$ bun upgrade
copy

Upgrade to the latest canary build
$ bun upgrade --canary
copy

Switch back to the latest stable version
$ bun upgrade --stable
copy

SYNOPSIS

bun upgrade [--canary]

PARAMETERS

--canary
    Upgrades Bun to the latest unstable (canary) release, which includes pre-release features and bug fixes but may be less stable.

DESCRIPTION

Bun is an incredibly fast all-in-one JavaScript runtime, bundler, transpiler, and package manager. The bun upgrade command is a fundamental utility within the Bun ecosystem, designed to ensure that your Bun installation is always up-to-date with the latest stable release. Running this command fetches the newest version of Bun available and replaces your current installation, incorporating performance improvements, bug fixes, and new features introduced by the Bun development team.

Keeping Bun updated is crucial for developers to leverage the most recent optimizations and maintain compatibility with modern JavaScript projects. It simplifies the process of managing the Bun runtime itself, eliminating the need for manual downloads or complex installation procedures when a new version is released. This command typically operates without requiring elevated permissions if Bun was installed in a user-local directory, otherwise sudo might be needed depending on the installation method. It ensures that you're always working with the most performant and secure version of Bun.

CAVEATS

Depending on your initial installation method, you might need sudo if Bun was installed system-wide or in a restricted directory.
Upgrading to a canary build might introduce instability or breaking changes, as these are pre-release versions not intended for production environments.
While bun upgrade is generally robust, it's always good practice to ensure important work is saved before performing system-level updates.

AUTOMATIC UPDATES

Bun does not automatically upgrade itself in the background. Users must explicitly run the bun upgrade command to get the latest version, providing full control over when updates occur.

CHECKING CURRENT VERSION

You can always verify your currently installed Bun version by running bun --version in your terminal, which is useful before and after an upgrade.

HISTORY

Bun is a relatively new project, first publicly released in 2022. Its rapid development and focus on performance have quickly gained traction in the JavaScript community. The bun upgrade command has been a core part of its CLI from early versions, reflecting the project's commitment to continuous improvement and easy maintainability for its users. It simplifies keeping up with Bun's frequent updates, which often include significant performance enhancements and new features crucial for its early adoption and growth.

SEE ALSO

bun(1), bun install(1), bun run(1), bun dev(1), bun build(1)

Copied to clipboard