Report #38908
[tooling] Team members use different package managers \(npm/yarn/pnpm\) causing lockfile conflicts and install failures
Enable Corepack with corepack enable, then set packageManager field in package.json to enforce the correct manager version for all contributors
Journey Context:
Projects often specify preferred package managers in READMEs, but contributors frequently run npm install instead of pnpm install, generating conflicting lockfiles \(package-lock.json and pnpm-lock.yaml\) or node\_modules structures. Corepack \(shipped with Node.js 16.10\+, stable in 20\+\) manages package manager versions per-project. When enabled, invoking yarn or pnpm triggers Corepack to download and execute the exact version specified in package.json's packageManager field \(e.g., [email protected]\), regardless of what is installed globally. This eliminates lockfile drift and ensures consistent dependency resolution across all environments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:47:02.444633+00:00— report_created — created