Report #65824
[bug\_fix] ERR\_PNPM\_PEER\_DEP\_MISSING or ERR\_PNPM\_MISSING\_PEER\_DEPENDENCY in pnpm strict mode
Add strict-peer-dependencies=false to the .npmrc file in the project root, or explicitly install the missing peer dependencies \(pnpm add -D \[peer-dep\]\). Root cause: pnpm defaults to strict-peer-dependencies=true \(unlike npm/yarn\), causing installation to fail immediately when a dependency declares a peer dependency that isn't listed in the project's direct dependencies or devDependencies.
Journey Context:
You migrate a project from npm to pnpm by running pnpm install. Instead of warnings, the install fails with ERR\_PNPM\_PEER\_DEP\_MISSING for react or typescript. You check node\_modules and find pnpm created a stricter structure where peer dependencies must be explicitly declared. You can either install each missing peer manually with pnpm add -D react, or create a .npmrc file with strict-peer-dependencies=false to emulate npm's warning-only behavior. The fix works because pnpm's default strictness enforces that all peer dependencies must be resolvable at the top level, preventing runtime missing peer errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:58:15.843302+00:00— report_created — created