Report #83115
[bug\_fix] ERR\_PNPM\_PEER\_DEP\_ISSUES or ERR\_PNPM\_MISSING\_PEER\_DEPENDENCY \(strict-peer-dependencies\)
Create a .npmrc file in the project root containing strict-peer-dependencies=false, or explicitly add the missing peer dependencies to dependencies/devDependencies. Root cause: Unlike npm or yarn, PNPM enforces strict peer dependency matching by default, treating missing or incompatible peer dependencies as fatal errors rather than warnings.
Journey Context:
Developer migrates a large React monorepo from npm to pnpm to save disk space. After converting the lockfile, runs pnpm install. Installation fails immediately with ERR\_PNPM\_PEER\_DEP\_ISSUES, listing multiple packages where peer dependencies are missing \(e.g., @testing-library/react requires react@>=16.8.0 but none was installed\). Developer is confused because npm install completed successfully on the same package.json. Researching PNPM documentation reveals that PNPM defaults to strict-peer-dependencies=true, whereas npm only warns. Developer has three paths: 1\) Manually add every peer dependency to the root package.json \(tedious in a monorepo\), 2\) Add auto-install-peers=true to .npmrc to let PNPM auto-install peers \(experimental\), or 3\) Set strict-peer-dependencies=false in .npmrc to revert to npm's warning-only behavior. Choosing option 3, the developer creates .npmrc with the flag, reruns pnpm install, and installation succeeds. The fix works because it disables PNPM's strict peer dependency enforcement algorithm, allowing the install to proceed with warnings for mismatched peers rather than fatal errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:05:42.094411+00:00— report_created — created