手动安装
如果你尚未使用 Node.js 或 npm(或任何其他包管理器),使用 Biome 的独立 CLI 二进制文件可能是一个不错的选择。或者换句话说,Biome 不应该是你拥有 package.json 的唯一原因。
¥Using Biome’s standalone CLI binary can be a great choice if you aren’t already using Node.js or npm (or any other package manager).
Or in other words, Biome shouldn’t be the only reason for you to have a package.json.
¥Supported platforms
你必须为你的平台选择正确的二进制文件才能运行 Biome。下表应该可以帮助你做到这一点。
¥You have to pick the correct binary for your platform for Biome work. The following table should help you do so.
| CPU 架构 | Windows | macOS | Linux | Linux (musl) |
|---|---|---|---|---|
arm64 | win32-arm64 | darwin-arm64(M1 或更新版本) | linux-arm64 | linux-arm64-musl |
x64 | win32-x64 | darwin-x64 | linux-x64 | linux-x64-musl |
Homebrew
Section titled “Homebrew”Biome 可作为 Homebrew 公式 供 macOS 和 Linux 用户使用。
¥Biome is available as a Homebrew formula for macOS and Linux users.
brew install biomeDocker
Section titled “Docker”Biome 发布了支持 amd64 和 arm64 架构的 官方 Docker 镜像,适用于从 v1.7.0 开始的所有 Biome 版本。
¥Biome publishes official Docker images that support
the amd64 and arm64 architectures for all Biome versions starting from v1.7.0.
ghcr.io/biomejs/biome:{major}ghcr.io/biomejs/biome:{major}.{minor}ghcr.io/biomejs/biome:{major}.{minor}.{patch}以下是使用 Docker 镜像的一些示例:
¥Here are a couple examples on how to use the Docker image:
# Lint filesdocker run -v $(pwd):/code ghcr.io/biomejs/biome lintdocker run -v $(pwd):/code ghcr.io/biomejs/biome lint --write
# Format filesdocker run -v $(pwd):/code ghcr.io/biomejs/biome formatdocker run -v $(pwd):/code ghcr.io/biomejs/biome format --write使用已发布的二进制文件
Section titled “使用已发布的二进制文件”¥Using a published binary
要安装 Biome,请从 GitHub 上的 最新 CLI 版本 获取适用于你平台的可执行文件并授予其执行权限。
¥To install Biome, grab the executable for your platform from the latest CLI release on GitHub and give it execution permission.
# macOS arm (M1 or newer)curl -L https://github.com/biomejs/biome/releases/download/@biomejs/biome@2.3.10/biome-darwin-arm64 -o biomechmod +x biome
# Linux (x86_64)curl -L https://github.com/biomejs/biome/releases/download/@biomejs/biome@2.3.10/biome-linux-x64 -o biomechmod +x biome
# Windows (x86_64, Powershell)Invoke-WebRequest -Uri "https://github.com/biomejs/biome/releases/download/@biomejs/biome@2.3.10/biome-win32-x64.exe" -OutFile "biome.exe"现在你只需运行 ./biome 即可使用 Biome。
¥Now you can use Biome by simply running ./biome.
¥Next Steps
遵循我们的 入门指南。
¥Follow our Getting Started guide.
Biome v2.1 中文网 - 粤ICP备13048890号