mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
This PR addresses several issues opened for the docs: - Add callout for SQLite caching behavior between prepare() and query() - Fix SQLite types and fix deprecated exec to run - Fix Secrets API example - Update SolidStart guide - Add bun upgrade guide - Prefer `process.versions.bun` over `typeof Bun` for detection - Document complete `bunx` flags - Improve Nitro preset documentation for Nuxt Fixes #23165, #24424, #24294, #25175, #18433, #16804, #22967, #22527, #10560, #14744
94 lines
2.1 KiB
Plaintext
94 lines
2.1 KiB
Plaintext
---
|
|
title: Upgrade Bun to the latest version
|
|
sidebarTitle: Upgrade Bun
|
|
mode: center
|
|
---
|
|
|
|
Bun can upgrade itself using the built-in `bun upgrade` command. This is the fastest way to get the latest features and bug fixes.
|
|
|
|
```bash terminal icon="terminal"
|
|
bun upgrade
|
|
```
|
|
|
|
This downloads and installs the latest stable version of Bun, replacing the currently installed version.
|
|
|
|
<Note>To see the current version of Bun, run `bun --version`.</Note>
|
|
|
|
---
|
|
|
|
## Verify the upgrade
|
|
|
|
After upgrading, verify the new version:
|
|
|
|
```bash terminal icon="terminal"
|
|
bun --version
|
|
# Output: 1.x.y
|
|
|
|
# See the exact commit of the Bun binary
|
|
bun --revision
|
|
# Output: 1.x.y+abc123def
|
|
```
|
|
|
|
---
|
|
|
|
## Upgrade to canary builds
|
|
|
|
Canary builds are automatically released on every commit to the `main` branch. These are untested but useful for trying new features or verifying bug fixes before they're released.
|
|
|
|
```bash terminal icon="terminal"
|
|
bun upgrade --canary
|
|
```
|
|
|
|
<Warning>Canary builds are not recommended for production use. They may contain bugs or breaking changes.</Warning>
|
|
|
|
---
|
|
|
|
## Switch back to stable
|
|
|
|
If you're on a canary build and want to return to the latest stable release:
|
|
|
|
```bash terminal icon="terminal"
|
|
bun upgrade --stable
|
|
```
|
|
|
|
---
|
|
|
|
## Install a specific version
|
|
|
|
To install a specific version of Bun, use the install script with a version tag:
|
|
|
|
<Tabs>
|
|
<Tab title="macOS & Linux">
|
|
```bash terminal icon="terminal"
|
|
curl -fsSL https://bun.sh/install | bash -s "bun-v1.3.3"
|
|
```
|
|
</Tab>
|
|
<Tab title="Windows">
|
|
```powershell PowerShell icon="windows"
|
|
iex "& {$(irm https://bun.sh/install.ps1)} -Version 1.3.3"
|
|
```
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
---
|
|
|
|
## Package manager users
|
|
|
|
If you installed Bun via a package manager, use that package manager to upgrade instead of `bun upgrade` to avoid conflicts.
|
|
|
|
<Tip>
|
|
**Homebrew users** <br />
|
|
To avoid conflicts with Homebrew, use `brew upgrade bun` instead.
|
|
|
|
**Scoop users** <br />
|
|
To avoid conflicts with Scoop, use `scoop update bun` instead.
|
|
|
|
</Tip>
|
|
|
|
---
|
|
|
|
## See also
|
|
|
|
- [Installation](/installation) — Install Bun for the first time
|
|
- [Update packages](/pm/cli/update) — Update dependencies to latest versions
|