ts-pnpm-workflow
Adopt pnpm as the package manager or migrate from npm (install, lockfile, scripts). Use when starting a Node project or migrating an npm project to pnpm.
Files1
View on GitHubSKILL.md.claude/skills/ts-pnpm-workflow/SKILL.md
GitHubPrerequisites
A package.json at the project root.
Steps
- Install — if
pnpm --versionfails:corepack enable pnpm, elsenpm install -g pnpm - Clean npm artifacts — delete
package-lock.jsonandnode_modules/ - Pin — set
"packageManager": "pnpm@<version>"inpackage.json(update if it already exists) .npmrc— create it only if the project needs pnpm settings; do not addshamefully-hoistunless a dependency breaks without it- Scripts — replace
npm run <x>withpnpm <x>inpackage.jsonscripts - Install and verify —
pnpm install(generatespnpm-lock.yaml), thenpnpm build
Gotchas
preinstall/postinstalllifecycle scripts can behave differently under pnpm — verify they run- Commit
pnpm-lock.yaml; make surepackage-lock.jsonis removed from tracking - Update CI to use pnpm
Report: summary, files changed, verify commands (pnpm build, pnpm test).