# 使用 Homebrew, chocolatey, MacPorts, Nix, pacman, scoop, winget 安装 bun

查看 bun 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:bun
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install bun
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install bun
```

  证据: MacPorts ports tree: devel/bun/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#bun
```

  证据: nixpkgs package indexes: pkgs/by-name/bu/bun/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S bun
```

  证据: Arch Linux sync databases: bun from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Chocolatey (92%):

```sh
choco install bun
```

  证据: Chocolatey community package catalog: bun from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','bluejeansapp'

- Scoop (92%):

```sh
scoop install main/bun
```

  证据: Scoop official bucket manifest trees: bucket/bun.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Oven-sh.Bun -e
```

  证据: Windows Package Manager source index: Oven-sh.Bun from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:bun
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/bun>
- **版本:** 1.3.14
- **来源摘要:** Incredibly fast JavaScript runtime, bundler, test runner, and package manager
- **主页:** <https://bun.com/>
- **仓库:** <https://github.com/oven-sh/bun>
- **上游文档:** <https://bun.com/docs>
- **许可证:** MIT AND LGPL-2.0-or-later AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND IJG AND LGPL-2.1-or-later AND Zlib AND (Apache-2.0 WITH LLVM-exception)
- **源码归档:** <https://github.com/oven-sh/bun.git>
- **最后更新:** 2026-06-03T16:56:51Z
- **已生成:** 2026-07-25T07:20:51+00:00

## 可执行文件

- bun (cli)
- bunx (cli)
- bun (别名)
- bunx (别名)

## 构建依赖

- cmake
- llvm@21
- ninja
- rust

## 安装行为

- post-install 钩子: 已定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-07-25
- 管理器版本: 1.3.14
- 管理器更新时间: 2026-06-03
- 本地数据: OK
- 上游仓库: https://github.com/oven-sh/bun
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

Bun is an all-in-one JavaScript and TypeScript toolkit: runtime, package manager, script runner, test runner, package runner, and bundler shipped as a single executable.

### 项目历史

Bun was created as a response to the accumulated layers of Node.js-era JavaScript tooling. The official 1.0 announcement, published on September 8, 2023, framed Bun as a stable, production-ready toolkit for running, building, testing, and debugging JavaScript and TypeScript.

The project is powered by JavaScriptCore rather than V8 and is designed as a faster, leaner, more modern replacement for Node.js while preserving compatibility with npm packages, Node-style module resolution, CommonJS, ES modules, Web APIs, and many Node built-ins.

Bun's documentation later described it as written in Rust and powered by JavaScriptCore, while the GitHub README emphasizes that the single `bun` command includes the runtime plus test runner, script runner, package manager, and package runner.

### 采用历史

Bun moved from an alternative runtime curiosity into mainstream JavaScript tooling after the 1.0 release because it promised speed without forcing developers to abandon existing package.json projects. Official install paths include shell installer, npm, Homebrew, Docker, and Windows PowerShell, and package-manager metadata now lists it across Homebrew, Chocolatey, MacPorts, Nix, pacman, Scoop, and winget.

Its adoption is tied to projects experimenting with faster local feedback loops: replacing Node for script execution, replacing npm/yarn/pnpm for installs, replacing Jest/Vitest in some tests, and replacing separate bundlers for simple build cases.

### 使用方式

Common commands include `bun run` for scripts and TypeScript files, `bun install` for npm-compatible dependency installation, `bun test` for tests, `bun build` for bundling, and `bunx` for executing packages. Configuration is optional and lives in local or global `bunfig.toml` files for Bun-specific settings.

Bun's package manager writes `node_modules`, reads package.json, uses a global cache, and supports workspaces and npm registry configuration. Because it aims to run existing Node.js applications with little or no change, usage often starts as a drop-in replacement for selected scripts rather than a full-stack rewrite.

### 为什么软件包爱好者会关心

Bun is significant because it collapses several previously separate JavaScript package tools into one binary. For package historians, it marks a major post-Node/npm phase where runtime, package manager, test runner, and bundler compete as integrated developer platforms rather than independent commands.

It is also important because it made package-manager performance and lockfile workflows part of a runtime's identity. Bun's rise pressured the broader ecosystem to treat install speed, TypeScript startup, test speed, and Node compatibility as one developer-experience surface.

### 时间线

- 2023-09-08: Bun 1.0 announced as stable and production-ready.
- 2024: 1.x releases continued expanding Node.js compatibility and toolkit coverage.
- 2025: Official docs describe Bun as a runtime, package manager, test runner, and bundler for modern JavaScript and TypeScript apps.
- 2026-05: GitHub release feed shows Bun v1.3.14 with ongoing 1.3.x releases.

### Related projects

- Bun is most directly related to Node.js, npm, yarn, pnpm, npx, ts-node, tsx, esbuild, webpack, Rollup, Parcel, Jest, Vitest, Deno, and the JavaScriptCore/WebKit project.

### 来源

- <https://bun.com/blog/bun-v1.0>
- <https://bun.com/blog/bun-v1.0.md>
- <https://bun.com/docs>
- <https://bun.com/docs/index.md>
- <https://bun.com/docs/runtime/bunfig.md>
- <https://github.com/oven-sh/bun>
- <https://raw.githubusercontent.com/oven-sh/bun/main/README.md>


## 安全说明

没有找到 bun 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: bunfig.toml, ~/.bunfig.toml, $XDG_CONFIG_HOME/.bunfig.toml

## Credential files

- Unix: bunfig.toml, ~/.bunfig.toml, $XDG_CONFIG_HOME/.bunfig.toml
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** bun
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Nix - bun: normalized package name match | nixpkgs package indexes: pkgs/by-name/bu/bun/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - bun - 1.3.14-1: normalized package name match | Arch Linux sync databases: bun from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one | https://github.com/oven-sh/bun
- MacPorts - bun: normalized package name match | MacPorts ports tree: devel/bun/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - bun: normalized package name match | Chocolatey community package catalog: bun from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','bluejeansapp'
- Scoop - main/bun: normalized package name match | Scoop official bucket manifest trees: bucket/bun.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Oven-sh.Bun: normalized package name match | Windows Package Manager source index: Oven-sh.Bun from https://cdn.winget.microsoft.com/cache/source.msix


## 相关链接

- [Package publisher tools](https://www.automicvault.com/zh-hans/pkg/package-publishers/) - Belongs to a package publishing or registry command family.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://www.automicvault.com/zh-hans/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [Networking and protocol packages](https://www.automicvault.com/zh-hans/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [cmake](https://www.automicvault.com/zh-hans/pkg/brew/cmake/) - Build dependency declared by Homebrew.
- [llvm@21](https://www.automicvault.com/zh-hans/pkg/brew/llvm-21/) - Build dependency declared by Homebrew.
- [ninja](https://www.automicvault.com/zh-hans/pkg/brew/ninja/) - Build dependency declared by Homebrew.
- [rust](https://www.automicvault.com/zh-hans/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [deno](https://www.automicvault.com/zh-hans/pkg/brew/deno/) - Shares av.db curated category or tags: cli, javascript, language-runtime, runtime, typescript.
- [duktape](https://www.automicvault.com/zh-hans/pkg/brew/duktape/) - Shares av.db curated category or tags: cli, javascript, language-runtime, runtime.
- [fibjs](https://www.automicvault.com/zh-hans/pkg/brew/fibjs/) - Shares av.db curated category or tags: cli, javascript, language-runtime, runtime.
- [n](https://www.automicvault.com/zh-hans/pkg/brew/n/) - Shares av.db curated category or tags: cli, javascript, language-runtime, runtime.
- [node](https://www.automicvault.com/zh-hans/pkg/brew/node/) - Shares av.db curated category or tags: cli, javascript, language-runtime, runtime.
- [quickjs](https://www.automicvault.com/zh-hans/pkg/brew/quickjs/) - Shares av.db curated category or tags: cli, javascript, language-runtime, runtime.
- [ringojs](https://www.automicvault.com/zh-hans/pkg/brew/ringojs/) - Shares av.db curated category or tags: cli, javascript, language-runtime, runtime.
- [spidermonkey](https://www.automicvault.com/zh-hans/pkg/brew/spidermonkey/) - Shares av.db curated category or tags: cli, javascript, language-runtime, runtime.
- [bun](https://www.automicvault.com/zh-hans/pkg/npm/bun/) - Same normalized package name appears in another local ecosystem. Shared terms: bun, bundler, bunx, cli, fast.
- [bun](https://www.automicvault.com/zh-hans/pkg/npm/bun/) - Same normalized package name in another local ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/bun.yml](https://github.com/automic-vault/db/blob/main/combined/bun.yml)


## 来源

- Nucleus package database
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
