pnpm

Manages Node.js dependencies with pnpm workspaces, catalogs, patches, and overrides.

Updated Jul 17, 2026
One-click install
npx skills add https://github.com/usmangurowa/socialmocks --skill pnpm-usmangurowa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pnpm
Source: https://github.com/usmangurowa/socialmocks/tree/main/.agents/skills/pnpm
Command: npx skills add https://github.com/usmangurowa/socialmocks --skill pnpm-usmangurowa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing Node.js dependencies across monorepos often leads to phantom dependencies, duplicated packages, inconsistent versions, and slow CI installs. This Skill provides guidance for using pnpm's strict resolution, content-addressable store, and workspace features to keep dependency management deterministic and disk-efficient. ## Core Features & Use Cases - Workspace & Monorepo Management: Configure pnpm-workspace.yaml, use the workspace: protocol, and filter packages with --filter for targeted builds and tests. - Version Control with Catalogs, Overrides, and Patches: Centralize shared dependency versions in catalogs, force transitive dependency versions with overrides, and patch third-party packages directly. - CI/CD and Performance Optimization: Apply --frozen-lockfile installs, store caching in GitHub Actions or Docker, and migration paths from npm or Yarn. - Use Case: When migrating a Turborepo monorepo from npm to pnpm, use this Skill to create pnpm-workspace.yaml, convert internal dependencies to workspace: protocol, deduplicate React versions via a catalog, and set up cached CI installs. ## Quick Start Ask the agent to set up a pnpm workspace for your monorepo and configure shared dependency versions using catalogs.

Frequently Asked Questions about pnpm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a monorepo from npm or Yarn to pnpm?

Remove old lockfiles and node_modules, create a pnpm-workspace.yaml listing your packages, and run pnpm install or pnpm import to convert existing lockfiles. Convert internal dependencies to the workspace: protocol and update scripts to use pnpm -r or --filter.

How do pnpm catalogs work for shared dependency versions?

Catalogs define dependency versions once in pnpm-workspace.yaml, and packages reference them with "catalog:" in package.json. Named catalogs support multiple version sets, and publishing replaces catalog references with actual versions.

Why does pnpm fail with phantom dependency errors?

pnpm uses strict isolated node_modules, so code cannot import packages not declared in package.json, unlike npm's hoisted layout. Fix it by adding the missing dependency explicitly, or use node-linker=hoisted for compatibility with tools that require flat node_modules.

How do I patch a third-party package with pnpm?

Run pnpm patch <pkg>@<version> to open an editable copy, make your changes, then run pnpm patch-commit with the provided path. pnpm saves a .patch file and records it under patchedDependencies in package.json, applying it on every install.

What pnpm settings should I use in CI pipelines?

Always run pnpm install --frozen-lockfile in CI so installs fail if the lockfile is outdated. Cache the pnpm store directory, pin the version with the packageManager field and Corepack, and use --filter to build only changed packages in monorepos.