skillfed

pnpm

This skill enables agents to handle Node.js package installation and dependency management through pnpm, a performant alternative to traditional package managers. Leverage pnpm's speed and storage efficiency to streamline your project's dependency lifecycle.

pnpm is a fast, disk-space-efficient Node.js package manager that serves as a performant alternative to npm and Yarn. Unlike npm, which duplicates dependencies across projects, pnpm uses a content-addressable store and symlinks to share dependencies globally, reducing disk usage significantly. pnpm also enforces stricter dependency resolution, preventing phantom dependencies and improving supply chain security. The MIT-licensed tool is designed to streamline your project's dependency lifecycle while maintaining compatibility with the npm ecosystem.

AI-generated summary based on this skill's SKILL.md

5,665 313 MIT updated by antfu

Install

antfu/skills/pnpm · repository language: TypeScript

CLI (skillfed)coming soon
git clone https://github.com/antfu/skills
cp -r skills/skills/pnpm ~/.claude/skills/pnpm

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is pnpm and how does it compare to npm?

pnpm is a fast, disk-space-efficient Node.js package manager that serves as a performant alternative to npm and Yarn. Unlike npm, which duplicates dependencies across projects, pnpm uses a content-addressable store and symlinks to share dependencies globally, reducing disk usage significantly. pnpm also enforces stricter dependency resolution, preventing phantom dependencies and improving supply chain security. The MIT-licensed tool is designed to streamline your project's dependency lifecycle while maintaining compatibility with the npm ecosystem.

How do you install dependencies and set up pnpm in a project?

To install pnpm, use npm or your system package manager. Once installed, pnpm install dependencies works similarly to npm: run `pnpm install` to fetch and lock dependencies based on your pnpm-lock.yaml file. pnpm leverages a global virtual store for efficient storage, meaning repeated installations across projects reuse cached packages. For CI/CD pipelines, use `pnpm ci` with a frozen lockfile to ensure reproducible builds without modifying the lock file during installation.

How do you configure pnpm workspace setup and monorepo structures?

pnpm excels at monorepo management through its workspace feature. Define your monorepo by creating a pnpm-workspace.yaml file at the root, listing workspace directories (e.g., `packages/*`). This configuration allows pnpm to treat multiple packages as a single dependency graph, enabling efficient cross-package linking and shared dependency resolution. pnpm's workspace setup reduces duplication and ensures consistent versions across your monorepo, making it ideal for complex project structures.

What are pnpm patches, overrides, and catalogs for controlling dependency versions?

pnpm provides three powerful tools for version control: patches allow you to modify dependencies without forking; overrides let you enforce specific versions across your dependency tree; and catalogs enable centralized version management for frequently used packages. These features give you fine-grained control over your dependency versions, reducing conflicts and improving maintainability. Together, they support pnpm's strict dependency resolution model while keeping your project's dependency landscape organized and predictable.

How can you migrate from npm or Yarn to pnpm?

Migrating to pnpm from npm or Yarn is straightforward: install pnpm, then run `pnpm install` in your project directory. pnpm automatically reads your existing package-lock.json or yarn.lock and generates its own pnpm-lock.yaml. For monorepos, ensure your pnpm-workspace.yaml is properly configured before migration. pnpm's strict dependency resolution may reveal phantom dependencies that npm tolerated, so you may need to add missing dependencies explicitly. The migration process typically completes quickly, and pnpm's performance gains become immediately apparent.

How does pnpm optimize performance and disk space efficiency?

pnpm achieves disk space efficiency through its content-addressable store, where each package version is stored once globally and linked into projects via symlinks. This eliminates the duplication that npm creates, often reducing disk usage by 60–80% across multiple projects. pnpm's strict dependency resolution and optimized installation algorithm also improve performance compared to traditional package managers. The global virtual store is managed automatically, and pnpm's dlx command allows running packages without installation, further reducing overhead in CI/CD environments.

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, and enforces strict dependency resolution by default, preventing phantom dependencies.

Configuration model (important): pnpm settings now live in pnpm-workspace.yaml (and the global config.yaml) using camelCase keys. .npmrc is used only for authentication/registry credentials, and the pnpm field of package.json is no longer read. When working in a pnpm project, check pnpm-workspace.yaml for settings/workspace structure and .npmrc only for auth. Always use --frozen-lockfile (or pnpm ci) in CI.

> The skill is based on pnpm 10.x, generated at 2026-06-22. It also

(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/best-practices-ci.md
skills/pnpm/references/best-practices-migration.md
skills/pnpm/references/best-practices-performance.md
skills/pnpm/references/core-cli.md
skills/pnpm/references/core-config.md
skills/pnpm/references/core-store.md
skills/pnpm/references/core-workspaces.md
skills/pnpm/references/features-aliases.md
skills/pnpm/references/features-catalogs.md
skills/pnpm/references/features-config-dependencies.md
skills/pnpm/references/features-global-virtual-store.md
skills/pnpm/references/features-hooks.md
skills/pnpm/references/features-overrides.md

Related skills

Tags

monorepo-management dependency-deduplication workspace-protocol lock-file-integrity package-patching version-catalogs ci-cd-optimization phantom-dependency-prevention multi-project-store