aube-package-manager
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAube Package Manager
Aube包管理器
Skill by ara.so — Daily 2026 Skills collection.
Aube is a fast Node.js package manager written in Rust. It drops into existing projects by reading and writing existing lockfiles (, , , ), uses a global content-addressable store to reduce disk usage, and delivers dramatically faster installs than pnpm or Bun — especially on warm CI.
pnpm-lock.yamlpackage-lock.jsonyarn.lockbun.lock由ara.so提供的技能 — 2026每日技能合集。
Aube是一款用Rust编写的快速Node.js包管理器。它可以直接接入现有项目,读取并写入现有锁文件(、、、),使用全局内容寻址存储来减少磁盘占用,并且安装速度远快于pnpm或Bun——尤其是在缓存已预热的CI环境中。
pnpm-lock.yamlpackage-lock.jsonyarn.lockbun.lockInstallation
安装
Via mise (recommended)
通过mise(推荐方式)
sh
undefinedsh
undefinedInstall globally
全局安装
mise use -g aube
mise use -g aube
Pin to a project
固定到项目中
mise use aube
mise use aube
Verify
验证版本
aube --version
undefinedaube --version
undefinedVia npm
通过npm
sh
npm install -g @endevco/aubesh
npm install -g @endevco/aubeVia Homebrew (beta tap)
通过Homebrew(测试源)
sh
brew install endevco/tap/aubesh
brew install endevco/tap/aubeCore Concepts
核心概念
- Lockfile compatibility: Reads and writes existing lockfiles in place — no forced migration.
- Global store: Package files live in (XDG) and are shared across projects.
~/.local/share/aube/store/ - Isolated layout: Packages link through — phantom dependencies are blocked.
node_modules/.aube/ - Secure defaults: New package releases wait a minimum age; lifecycle scripts require explicit approval.
- 锁文件兼容性:读取并原地写入现有锁文件——无需强制迁移。
- 全局存储:包文件存储在(XDG标准路径),可在多个项目间共享。
~/.local/share/aube/store/ - 隔离式布局:包通过链接——杜绝幽灵依赖。
node_modules/.aube/ - 安全默认配置:新包版本需等待最短发布时长;生命周期脚本需要显式授权才能运行。
Key Commands
核心命令
Install & Dependency Management
安装与依赖管理
sh
aube install # Install all dependencies
aube install -r # Install across all workspace packages
aube install --prod # Production dependencies only
aube install --lockfile-only # Update lockfile without touching node_modules
aube add react # Add a runtime dependency
aube add -D vitest # Add a dev dependency
aube add zod --filter @acme/api # Add to a specific workspace package
aube remove react # Remove a dependency
aube update # Update deps within package.json rangessh
aube install # 安装所有依赖
aube install -r # 安装工作区所有包的依赖
aube install --prod # 仅安装生产依赖
aube install --lockfile-only # 更新锁文件但不修改node_modules
aube add react # 添加运行时依赖
aube add -D vitest # 添加开发依赖
aube add zod --filter @acme/api # 为指定工作区包添加依赖
aube remove react # 删除依赖
aube update # 在package.json版本范围内更新依赖CI
CI环境
sh
aube ci # Clean install: removes node_modules, verifies lockfile is fresh, installsUse in CI pipelines where the lockfile must be the source of truth.
aube cish
aube ci # 纯净安装:删除node_modules,验证锁文件有效性,执行安装在锁文件作为可信来源的CI流水线中使用。
aube ciRunning Scripts and Binaries
运行脚本与二进制文件
sh
aube run build # Run a package.json script
aube run test # Run test script (auto-installs if deps are stale)
aube test # Shortcut: same as `aube run test`
aube dev # Any script name works directly as a subcommand
aube build
aube lint
aube exec vitest # Run a local binary from node_modules/.bin
aube dlx cowsay hi # Run a package in a throwaway environment (like npx)sh
aube run build # 运行package.json中的脚本
aube run test # 运行测试脚本(若依赖过期则自动安装)
aube test # 快捷命令:等同于`aube run test`
aube dev # 任何脚本名称均可直接作为子命令使用
aube build
aube lint
aube exec vitest # 运行node_modules/.bin中的本地二进制文件
aube dlx cowsay hi # 在临时环境中运行包(类似npx)Multicall Shims
多调用垫片
sh
aubr build # Equivalent to: aube run build
aubx cowsay hi # Equivalent to: aube dlx cowsay hish
aubr build # 等同于:aube run build
aubx cowsay hi # 等同于:aube dlx cowsay hiInspection & Maintenance
检查与维护
sh
aube list # List installed packages
aube why react # Explain why a package is installed
aube outdated # Show outdated dependencies
aube audit # Security audit
aube store path # Show global store location
aube store prune # Remove unused packages from global store
aube config get registry # Read config valuessh
aube list # 列出已安装的包
aube why react # 解释某个包被安装的原因
aube outdated # 显示过期依赖
aube audit # 安全审计
aube store path # 显示全局存储路径
aube store prune # 从全局存储中删除未被使用的包
aube config get registry # 读取配置值Publishing
发布
sh
aube pack # Pack a package tarball
aube publish # Publish to registry
aube link # Link a local package
aube unlink # Unlink a local packagesh
aube pack # 打包成包压缩包
aube publish # 发布到仓库
aube link # 链接本地包
aube unlink # 取消链接本地包Lockfile Compatibility
锁文件兼容性
| File | Reads | Writes in place |
|---|---|---|
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
Not supported:
- pnpm v5/v6 lockfiles (upgrade with pnpm first)
- Yarn PnP projects (switch to linker first)
node_modules
| 文件 | 读取 | 原地写入 |
|---|---|---|
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
不支持:
- pnpm v5/v6锁文件(需先用pnpm升级)
- Yarn PnP项目(需先切换到链接器)
node_modules
Workspaces
工作区
sh
undefinedsh
undefinedInstall across all workspace packages
安装工作区所有包的依赖
aube install -r
aube install -r
Run a script in all workspace packages
在工作区所有包中运行脚本
aube run test -r
aube run test -r
Add a dependency to a specific package
为指定包添加依赖
aube add zod --filter @acme/api
aube add -D typescript --filter @acme/shared
Workspace config files:
- `pnpm-workspace.yaml` — read and written if present
- `aube-workspace.yaml` — used for aube-first projects
Example `aube-workspace.yaml`:
```yaml
packages:
- "packages/*"
- "apps/*"aube add zod --filter @acme/api
aube add -D typescript --filter @acme/shared
工作区配置文件:
- `pnpm-workspace.yaml` — 若存在则读取并写入
- `aube-workspace.yaml` — 用于优先使用aube的项目
`aube-workspace.yaml`示例:
```yaml
packages:
- "packages/*"
- "apps/*"Dependency Lifecycle Scripts
依赖生命周期脚本
Aube skips lifecycle scripts by default for security.
sh
undefined出于安全考虑,Aube默认跳过生命周期脚本。
sh
undefinedSee which packages had scripts skipped
查看哪些包的脚本被跳过
aube ignored-builds
aube ignored-builds
Approve specific packages to run their build scripts
授权特定包运行其构建脚本
aube approve-builds
After approval, the allowed packages are recorded in your project config so teammates get the same behavior.aube approve-builds
授权后,允许的包会被记录到项目配置中,确保团队成员拥有相同的行为。Configuration
配置
Aube reads config from under key or from / .
package.json"aube".aubercaube.config.yamljson
{
"name": "my-app",
"aube": {
"registry": "https://registry.npmjs.org/",
"store-dir": "/custom/store/path"
}
}sh
undefinedAube从的字段或 / 读取配置。
package.json"aube".aubercaube.config.yamljson
{
"name": "my-app",
"aube": {
"registry": "https://registry.npmjs.org/",
"store-dir": "/custom/store/path"
}
}sh
undefinedRead a config value
读取配置值
aube config get registry
aube config get registry
Set a config value
设置配置值
aube config set registry https://my-private-registry.example.com
undefinedaube config set registry https://my-private-registry.example.com
undefinedCI/CD Patterns
CI/CD模式
GitHub Actions
GitHub Actions
yaml
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install mise
uses: jdx/mise-action@v2
- name: Install aube
run: mise use -g aube
- name: Cache aube store
uses: actions/cache@v4
with:
path: ~/.local/share/aube/store
key: aube-store-${{ hashFiles('**/pnpm-lock.yaml', '**/aube-lock.yaml') }}
restore-keys: |
aube-store-
- name: Install dependencies
run: aube ci
- name: Run tests
run: aube testyaml
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install mise
uses: jdx/mise-action@v2
- name: Install aube
run: mise use -g aube
- name: Cache aube store
uses: actions/cache@v4
with:
path: ~/.local/share/aube/store
key: aube-store-${{ hashFiles('**/pnpm-lock.yaml', '**/aube-lock.yaml') }}
restore-keys: |
aube-store-
- name: Install dependencies
run: aube ci
- name: Run tests
run: aube testDocker
Docker
dockerfile
FROM node:22-slimdockerfile
FROM node:22-slimInstall aube via npm
通过npm安装aube
RUN npm install -g @endevco/aube
WORKDIR /app
RUN npm install -g @endevco/aube
WORKDIR /app
Copy lockfile and package.json first for layer caching
先复制锁文件和package.json以利用分层缓存
COPY package.json pnpm-lock.yaml ./
COPY package.json pnpm-lock.yaml ./
Frozen install — fail if lockfile would change
冻结安装——若锁文件需更改则失败
RUN aube ci
COPY . .
RUN aube run build
CMD ["node", "dist/index.js"]
undefinedRUN aube ci
COPY . .
RUN aube run build
CMD ["node", "dist/index.js"]
undefinedLockfile-only update (for Docker layer caching)
仅更新锁文件(用于Docker分层缓存)
sh
undefinedsh
undefinedOnly update the lockfile, don't install into node_modules
仅更新锁文件,不安装到node_modules
aube install --lockfile-only
undefinedaube install --lockfile-only
undefinedMigrating from pnpm
从pnpm迁移
sh
undefinedsh
undefined1. Install aube
1. 安装aube
mise use -g aube
mise use -g aube
2. Run in your existing project — aube reads pnpm-lock.yaml
2. 在现有项目中运行——aube会读取pnpm-lock.yaml
cd my-project
aube install
cd my-project
aube install
3. Approve any build scripts that pnpm was running
3. 授权pnpm之前运行的所有构建脚本
aube approve-builds
aube approve-builds
4. Replace pnpm scripts in package.json (optional)
4. 替换package.json中的pnpm脚本(可选)
Before: "scripts": { "postinstall": "pnpm run build:native" }
替换前:"scripts": { "postinstall": "pnpm run build:native" }
After: keep as-is, aube runs package.json scripts the same way
替换后:保持原样,aube以相同方式运行package.json脚本
undefinedundefinedMigrating from npm/yarn
从npm/yarn迁移
sh
undefinedsh
undefinednpm — aube reads package-lock.json
npm — aube读取package-lock.json
cd my-npm-project
aube install
cd my-npm-project
aube install
yarn classic — aube reads yarn.lock
yarn经典版 — aube读取yarn.lock
cd my-yarn-project
aube install
cd my-yarn-project
aube install
Bun — aube reads bun.lock
Bun — aube读取bun.lock
cd my-bun-project
aube install
undefinedcd my-bun-project
aube install
undefinedCommon Patterns
常见模式
Monorepo with filtered commands
带过滤命令的单体仓库
sh
undefinedsh
undefinedBuild only the API package
仅构建API包
aube run build --filter @acme/api
aube run build --filter @acme/api
Run tests in all packages that changed
在所有有变更的包中运行测试
aube run test --filter '...[origin/main]'
aube run test --filter '...[origin/main]'
Install and run in one step (auto-install if stale)
一步完成安装与运行(若依赖过期则自动安装)
aube exec vitest --run
undefinedaube exec vitest --run
undefinedGlobal store management
全局存储管理
sh
undefinedsh
undefinedFind where the store lives
查看存储位置
aube store path
aube store path
→ ~/.local/share/aube/store
→ ~/.local/share/aube/store
Clean up packages no longer used by any project
清理所有项目不再使用的包
aube store prune
undefinedaube store prune
undefinedChecking why a package is installed
检查某个包被安装的原因
sh
aube why lodashsh
aube why lodashShows the dependency chain that requires lodash
显示需要lodash的依赖链
undefinedundefinedTroubleshooting
故障排查
aube ci
fails with lockfile mismatch
aube ciaube ci
因锁文件不匹配失败
aube ciThe lockfile is out of sync with . Fix locally:
package.jsonsh
aube install # updates lockfile
git add pnpm-lock.yaml
git commit -m "chore: update lockfile"锁文件与不同步。在本地修复:
package.jsonsh
aube install # 更新锁文件
git add pnpm-lock.yaml
git commit -m "chore: update lockfile"Build scripts not running
构建脚本未运行
Aube skips lifecycle scripts by default. Check what was skipped:
sh
aube ignored-builds
aube approve-builds # interactively approve packagesAube默认跳过生命周期脚本。查看哪些脚本被跳过:
sh
aube ignored-builds
aube approve-builds # 交互式授权包Package phantom dependency errors
包幽灵依赖错误
Aube uses an isolated layout — packages can only import their declared dependencies. Fix by adding the missing dependency explicitly:
sh
aube add <missing-package>Aube使用隔离式布局——包只能导入已声明的依赖。通过显式添加缺失的依赖修复:
sh
aube add <missing-package>Slow first install / cold cache
首次安装慢/缓存未预热
The first install populates the global store. Subsequent installs (same or other projects with shared deps) will be significantly faster. Cache in CI for warm-cache performance.
~/.local/share/aube/store首次安装会填充全局存储。后续安装(相同或有共享依赖的其他项目)将显著加快。在CI中缓存以获得预热缓存的性能。
~/.local/share/aube/storepnpm v5/v6 lockfile not supported
pnpm v5/v6锁文件不被支持
sh
undefinedsh
undefinedUpgrade lockfile with pnpm first
先用pnpm升级锁文件
pnpm install # regenerates as v9 format
pnpm install # 重新生成v9格式的锁文件
Then switch to aube
然后切换到aube
aube install
undefinedaube install
undefinedYarn PnP projects
Yarn PnP项目
Aube writes , not . Switch the Yarn linker first:
node_modules.pnp.cjssh
undefinedAube写入,而非。先切换Yarn链接器:
node_modules.pnp.cjssh
undefinedIn .yarnrc.yml
在.yarnrc.yml中
nodeLinker: node-modules
yarn install # regenerates yarn.lock for node-modules layout
aube install # now aube can take over
undefinednodeLinker: node-modules
yarn install # 重新生成为node-modules布局的yarn.lock
aube install # 现在aube可以接管
undefined