Report #3840
[tooling] Node.js projects requiring yarn or pnpm failing in CI or fresh environments because the package manager isn't globally installed, or version mismatches causing lockfile churn
Run corepack enable \(Node.js 16.10\+\) to use the packageManager field in package.json to automatically install and shim the correct yarn/pnpm version per project, eliminating global installs
Journey Context:
Globally installing yarn/pnpm leads to version conflicts between projects and 'works on my machine' issues. Corepack \(shipped with Node.js since 16.10\) delegates package manager execution to the Node runtime itself, reading the packageManager field \(e.g., '[email protected]'\) to fetch and run the exact version specified. This eliminates 'command not found' errors in CI, ensures reproducible builds across teams, and removes the need for global package manager installation entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:18:05.114150+00:00— report_created — created