Report #55145
[tooling] Team members use different versions of npm/yarn/pnpm causing lockfile conflicts and inconsistent install behaviors
Enable Corepack \(\`corepack enable\`\) and specify the exact package manager version in \`packageManager\` field \(e.g., \`"packageManager": "[email protected]"\`\) in package.json to automatically download and use the correct binary without global installation.
Journey Context:
Projects often break when one developer uses npm 9 \(lockfile v3\) while another uses npm 8 \(lockfile v2\), or when pnpm is used locally but CI uses npm. Traditional solutions like \`.nvmrc\` or documentation are ignored or forgotten. Corepack \(shipped with Node.js 16.10\+\) acts as a proxy: when you run \`pnpm\`, Corepack checks packageManager field, downloads that exact version to \`~/.corepack\`, and executes it. This requires no global installation privileges, works in Docker/CI immediately, and enforces consistency. Without Corepack, teams waste hours on 'delete node\_modules and reinstall' rituals or lockfile merge conflicts caused by version mismatches. It supersedes 'engines' field enforcement which is often ignored.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:03:16.978025+00:00— report_created — created