bun-package-manager

v2026.09.24

Fast JavaScript package management with Bun — install, add, remove, update. Use when installing all deps, adding/removing packages, running `bun update`/`outdated`, managing workspaces, doing a `--frozen-lockfile` CI install, or debugging conflicts.

GitHub
安装命令
npx skhub add laurigates/bun-package-manager
Markdown
SKILL.md

Bun Package Manager

When to Use This Skill

ScenarioUse this skillAlternative
Installing all project dependenciesYesN/A
Adding or removing packagesYesbun-add for quick single-package additions
Updating packages or checking outdatedYesN/A
Managing workspace dependenciesYesN/A
CI reproducible installs (--frozen-lockfile)YesN/A
Running scripts or testsNo - use bun-developmentbun-test for quick test runs
Publishing packages to npmNo - use bun-publishingN/A
Debugging lockfile conflictsYesbun-lockfile-update for targeted lockfile operations

Core Expertise

Bun's package manager is significantly faster than npm/yarn/pnpm:

  • ~7x faster than npm
  • ~4x faster than pnpm
  • Native workspace support
  • Compatible with npm registry

Essential Commands

Install Dependencies

# Standard install
bun install

# CI/reproducible (frozen lockfile)
bun install --frozen-lockfile

# Production only (no devDependencies)
bun install --production

# Force reinstall
bun install --force

# Dry run (preview)
bun install --dry-run

Add Packages

# Add dependency
bun add <package>

# Add dev dependency
bun add --dev <package>
bun add -d <package>

# Pin exact version (no ^)
bun add --exact <package>
bun add -E <package>

# Global install
bun add --global <package>
bun add -g <package>

# Add to specific workspace
bun add <package> --cwd packages/mylib

Remove Packages

# Remove dependency
bun remove <package>

# Remove from devDependencies
bun remove --dev <package>

# Dry run
bun remove --dry-run <package>

Update Packages

# Update within semver ranges
bun update

# Update to latest (ignore ranges)
bun update --latest

# Interactive selection
bun update --interactive

# Update across workspaces
bun update --recursive

Inspect Dependencies

# Check outdated packages
bun outdated

# Why is package installed?
bun why <package>

# List installed packages
bun pm ls

# View package cache
bun pm cache

Workspace Management

Configuration

{
  "name": "monorepo",
  "private": true,
  "workspaces": ["packages/*", "apps/*"]
}

Workspace Operations

# Install all workspace deps
bun install

# Add to specific workspace
bun add express --cwd apps/api

# Run in matching workspaces
bun run --filter 'package-*' build

# Run in all workspaces
bun run --workspaces test

Inter-workspace Dependencies

{
  "dependencies": {
    "shared-utils": "workspace:*"
  }
}

Agentic Optimizations

ContextCommand
CI installbun install --frozen-lockfile
Prod deploybun install --production
Preview changesbun add --dry-run <pkg>
Exact versionsbun add --exact <pkg>
Workspace targetbun add <pkg> --cwd <path>
Force refreshbun install --force

Quick Reference

FlagShortDescription
--frozen-lockfileFail if lockfile changes
--production-pSkip devDependencies
--dev-dAdd to devDependencies
--exact-EPin exact version
--global-gGlobal install
--dry-runPreview without executing
--force-fForce reinstall all
--cwd <path>Target directory
--latestUpdate to latest version
--recursiveApply across workspaces

Error Handling

Common Issues

Lockfile mismatch in CI:

# Use frozen lockfile
bun install --frozen-lockfile

Peer dependency conflicts:

# Force install anyway
bun install --force

Package not found:

# Check if package exists
bun why <package>

Environment Variables

VariableDescription
BUN_OPTIONSGlobal CLI flags
BUN_INSTALLBun installation directory
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

MIT

源路径

typescript-plugin/skills/bun-package-manager

默认分支

main

最新提交

1668324

Tree SHA

b2d4cc3