pnpm
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesepnpm is a fast, disk space efficient package manager. It uses a content-addressable store to deduplicate packages across all projects on a machine, saving significant disk space. pnpm enforces strict dependency resolution by default, preventing phantom dependencies. Configuration should preferably be placed in for pnpm-specific settings.
pnpm-workspace.yamlImportant: When working with pnpm projects, agents should check for and files to understand workspace structure and configuration. Always use in CI environments.
pnpm-workspace.yaml.npmrc--frozen-lockfileThe skill is based on pnpm 10.x, generated at 2026-01-28.
pnpm是一款快速、磁盘空间高效的包管理器。它使用内容可寻址存储来在一台机器上的所有项目中重复数据删除包,节省大量磁盘空间。pnpm默认强制严格的依赖解析,防止幽灵依赖。配置最好放在中以设置pnpm专属的配置项。
pnpm-workspace.yaml重要提示: 处理pnpm项目时,Agent应检查和文件以了解工作区结构和配置。在CI环境中始终使用参数。
pnpm-workspace.yaml.npmrc--frozen-lockfile本Skill基于pnpm 10.x版本生成,生成时间为2026-01-28。
Core
核心功能
| Topic | Description | Reference |
|---|---|---|
| CLI Commands | Install, add, remove, update, run, exec, dlx, and workspace commands | core-cli |
| Configuration | pnpm-workspace.yaml, .npmrc settings, and package.json fields | core-config |
| Workspaces | Monorepo support with filtering, workspace protocol, and shared lockfile | core-workspaces |
| Store | Content-addressable storage, hard links, and disk efficiency | core-store |
| 主题 | 描述 | 参考 |
|---|---|---|
| CLI命令 | 安装、添加、移除、更新、运行、执行、dlx和工作区命令 | core-cli |
| 配置 | pnpm-workspace.yaml、.npmrc设置和package.json字段 | core-config |
| 工作区 | 支持单体仓库(Monorepo),包含过滤、工作区协议和共享锁文件 | core-workspaces |
| 存储 | 内容可寻址存储、硬链接和磁盘效率 | core-store |
Features
扩展功能
| Topic | Description | Reference |
|---|---|---|
| Catalogs | Centralized dependency version management for workspaces | features-catalogs |
| Overrides | Force specific versions of dependencies including transitive | features-overrides |
| Patches | Modify third-party packages with custom fixes | features-patches |
| Aliases | Install packages under custom names using npm: protocol | features-aliases |
| Hooks | Customize resolution with .pnpmfile.cjs hooks | features-hooks |
| Peer Dependencies | Auto-install, strict mode, and dependency rules | features-peer-deps |
| 主题 | 描述 | 参考 |
|---|---|---|
| 目录(Catalogs) | 为工作区提供集中式依赖版本管理 | features-catalogs |
| 覆盖(Overrides) | 强制指定依赖的特定版本,包括传递依赖 | features-overrides |
| 补丁(Patches) | 使用自定义修复修改第三方包 | features-patches |
| 别名(Aliases) | 使用npm:协议以自定义名称安装包 | features-aliases |
| 钩子(Hooks) | 使用.pnpmfile.cjs钩子自定义解析逻辑 | features-hooks |
| 对等依赖(Peer Dependencies) | 自动安装、严格模式和依赖规则 | features-peer-deps |
Best Practices
最佳实践
| Topic | Description | Reference |
|---|---|---|
| CI/CD Setup | GitHub Actions, GitLab CI, Docker, and caching strategies | best-practices-ci |
| Migration | Migrating from npm/Yarn, handling phantom deps, monorepo migration | best-practices-migration |
| Performance | Install optimizations, store caching, workspace parallelization | best-practices-performance |
| 主题 | 描述 | 参考 |
|---|---|---|
| CI/CD设置 | GitHub Actions、GitLab CI、Docker和缓存策略 | best-practices-ci |
| 迁移 | 从npm/Yarn迁移、处理幽灵依赖、单体仓库迁移 | best-practices-migration |
| 性能 | 安装优化、存储缓存、工作区并行化 | best-practices-performance |