pnpm
pnpm is a high-performance package manager that streamlines dependency installation and management for Node.js projects. It uses a content-addressable storage model to minimize disk usage while maintaining compatibility with npm and yarn ecosystems. Ideal for teams seeking faster builds and more efficient resource utilization across development environments.
pnpm is a high-performance package manager that streamlines dependency installation and management for Node.js projects. Unlike npm, pnpm uses a content-addressable storage model to minimize disk usage while maintaining compatibility with npm and yarn ecosystems. This approach makes pnpm ideal for teams seeking faster builds and more efficient resource utilization across development environments.
AI-generated summary based on this skill's SKILL.md
Install
sanity-io/next-sanity/pnpm · repository language: TypeScript
git clone https://github.com/sanity-io/next-sanity
cp -r next-sanity/.agents/skills/pnpm ~/.claude/skills/pnpmFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is pnpm and how does it differ from npm?
pnpm is a high-performance package manager that streamlines dependency installation and management for Node.js projects. Unlike npm, pnpm uses a content-addressable storage model to minimize disk usage while maintaining compatibility with npm and yarn ecosystems. This approach makes pnpm ideal for teams seeking faster builds and more efficient resource utilization across development environments.
How do I use pnpm to install dependencies?
pnpm handles dependency installation through its core intent to install and manage Node.js project dependencies with pnpm. After installing pnpm, you can run `pnpm install` in your project directory to fetch and set up all dependencies listed in your package.json. pnpm's strict dependency resolution prevents phantom dependencies, ensuring only explicitly declared packages are accessible to your code.
How can pnpm workspace setup and monorepo configuration be achieved?
pnpm excels at configuring and running monorepo workspaces through its workspace.yaml configuration file. You define your workspace structure in pnpm-workspace.yaml, specifying which directories contain individual packages. pnpm then manages dependencies across all packages in your monorepo, allowing shared dependencies to be hoisted intelligently while maintaining strict isolation between workspace packages.
What are pnpm catalogs and overrides, and how do I apply patches to third-party packages?
pnpm provides multiple mechanisms to control dependency versions: catalogs centralize version definitions across your monorepo, overrides enforce specific versions globally, and patches allow you to modify third-party packages without forking them. These features work together to give you fine-grained control over your dependency tree, ensuring consistency and enabling quick fixes for upstream issues.
How does pnpm optimize disk space and CI/CD performance?
pnpm optimizes disk space and CI/CD performance through its content-addressable store and hard links strategy. Instead of duplicating packages, pnpm stores each dependency version once and uses hard links to reference it across projects. For CI/CD, you can use `pnpm install --frozen-lockfile` to ensure reproducible builds and faster installation times by preventing dependency resolution during the build process.
How do I migrate from npm to pnpm?
Migrating to pnpm from npm is straightforward: install pnpm, then run `pnpm install` in your project directory. pnpm reads your existing package.json and package-lock.json, creating its own pnpm-lock.yaml lockfile. The main adjustment is understanding pnpm's strict dependency resolution and phantom dependency prevention—only packages explicitly listed in your package.json are accessible, which may require adding missing direct dependencies that npm's flattening previously made available.
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-01-28.
Core
| Topic | Description | Reference | | ------------- |
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 15 files
.agents/skills/pnpm/GENERATION.md
.agents/skills/pnpm/SKILL.md
.agents/skills/pnpm/references/best-practices-ci.md
.agents/skills/pnpm/references/best-practices-migration.md
.agents/skills/pnpm/references/best-practices-performance.md
.agents/skills/pnpm/references/core-cli.md
.agents/skills/pnpm/references/core-config.md
.agents/skills/pnpm/references/core-store.md
.agents/skills/pnpm/references/core-workspaces.md
.agents/skills/pnpm/references/features-aliases.md
.agents/skills/pnpm/references/features-catalogs.md
.agents/skills/pnpm/references/features-hooks.md
.agents/skills/pnpm/references/features-overrides.md
.agents/skills/pnpm/references/features-patches.md
.agents/skills/pnpm/references/features-peer-deps.md