pnpm
pnpm is a high-performance package manager designed for Node.js projects that prioritizes speed and storage efficiency. It streamlines dependency installation and management through innovative linking strategies, making it ideal for monorepos and large-scale development environments. Integrate pnpm into your workflow to reduce disk usage and accelerate build times across your projects.
pnpm installs Node.js project dependencies efficiently using a content-addressable store that deduplicates packages across your system. Run `pnpm install` to install all dependencies listed in your package.json and pnpm-lock.yaml files. pnpm uses hard links and symlinks to minimize disk space while maintaining strict dependency resolution, preventing phantom dependencies that can occur with other package managers. For CI environments, use `pnpm install --frozen-lockfile` to ensure reproducible builds.
AI-generated summary based on this skill's SKILL.md
Install
hairyf/skills/pnpm · repository language: MDX
git clone https://github.com/hairyf/skills
cp -r skills/skills/pnpm ~/.claude/skills/pnpmFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I use pnpm to install dependencies?
pnpm installs Node.js project dependencies efficiently using a content-addressable store that deduplicates packages across your system. Run `pnpm install` to install all dependencies listed in your package.json and pnpm-lock.yaml files. pnpm uses hard links and symlinks to minimize disk space while maintaining strict dependency resolution, preventing phantom dependencies that can occur with other package managers. For CI environments, use `pnpm install --frozen-lockfile` to ensure reproducible builds.
What is pnpm workspace configuration and how do I set it up for a monorepo?
pnpm monorepo workspaces are configured through a pnpm-workspace.yaml file that defines which directories contain separate packages. Create a workspace.yaml at your repository root listing package directories (e.g., `packages/*`), then pnpm automatically recognizes and links these local packages together. pnpm's workspace configuration enables you to run commands across multiple packages, manage shared dependencies efficiently, and publish packages independently—making it ideal for monorepo setups where you need coordinated but separate package management.
How does pnpm's strict dependency resolution prevent phantom dependencies?
pnpm enforces strict dependency resolution by only allowing packages to access dependencies they explicitly declare in their package.json, preventing phantom dependencies where code accidentally relies on transitive dependencies. Unlike npm or yarn, pnpm's node_modules structure uses symlinks that create an isolated dependency tree for each package. This strict approach catches dependency bugs early and improves supply chain security by ensuring every import has a declared dependency, making your projects more maintainable and predictable.
What advanced features like catalogs and patches does pnpm offer?
pnpm provides advanced features for managing complex projects: catalogs enable centralized version management across your monorepo by defining dependency versions in one place, patches allow you to modify third-party packages without forking them, and overrides let you enforce specific versions globally. These tools give you fine-grained control over your dependency tree, making it easier to maintain consistency, apply security fixes, and manage breaking changes across large codebases without duplicating configuration.
How does pnpm's content-addressable store optimize disk space and performance?
pnpm's content-addressable store deduplicates packages by storing each version only once on disk, then using hard links to reference it from multiple projects. This approach dramatically reduces disk space usage compared to npm or yarn, which store separate copies in each project's node_modules. The store also accelerates installation by reusing already-downloaded packages, making pnpm particularly efficient for monorepos and CI/CD environments where multiple projects share common dependencies.
How do I add a package to my project using pnpm?
Use the `pnpm add package-name` command to install and add a package to your project's dependencies. pnpm automatically updates your package.json and pnpm-lock.yaml files with the new dependency. For development dependencies, use `pnpm add -D package-name`, and for workspace packages, you can reference local packages by their names. pnpm's add command integrates seamlessly with its strict dependency resolution and content-addressable store, ensuring efficient installation while maintaining clear dependency declarations.
SKILL.md
rendered from the published skill — quoted content, verbatim
pnpm 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 pnpm-workspace.yaml for pnpm-specific settings.
Important: When working with pnpm projects, agents should check for pnpm-workspace.yaml and .npmrc files to understand workspace structure and configuration. Always use --frozen-lockfile in CI environments.
> The skill is based on pnpm 10.x, generated at 2026-02-01.
Core
| Topic | Description | Reference |
|---|---|---|
| Installation | Standalone script, Corepack, npm, system package managers |
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 15 files
skills/pnpm/GENERATION.md
skills/pnpm/SKILL.md
skills/pnpm/references/advanced-limitations.md
skills/pnpm/references/best-practices-ci.md
skills/pnpm/references/best-practices-docker.md
skills/pnpm/references/best-practices-git.md
skills/pnpm/references/best-practices-migration.md
skills/pnpm/references/best-practices-only-allow-pnpm.md
skills/pnpm/references/best-practices-performance.md
skills/pnpm/references/best-practices-podman.md
skills/pnpm/references/best-practices-production.md
skills/pnpm/references/best-practices-typescript.md
skills/pnpm/references/core-cli.md
skills/pnpm/references/core-config.md
skills/pnpm/references/core-errors.md