Report #21018
[bug\_fix] ERR\_PNPM\_PEER\_DEP\_ISSUES Unmet peer dependencies
Add the missing peer dependencies explicitly to your package.json devDependencies, or create a .npmrc file with strict-peer-dependencies=false to allow pnpm to auto-install peers like npm does. Root cause: pnpm's strict-peer-dependencies setting \(default in pnpm 7\+\) enforces that all peer dependencies must be explicitly declared in the direct dependencies, whereas npm hoists and auto-installs them with warnings.
Journey Context:
A development team decides to migrate their React monorepo from npm to pnpm to save disk space and enforce stricter dependency boundaries. After installing pnpm and running pnpm install in the project root, the install fails immediately with ERR\_PNPM\_PEER\_DEP\_ISSUES listing multiple unmet peer dependencies: react@^18.0.0 is required by react-dom but not found, and eslint-plugin-react requires react@>=16.8.0. The developer is confused because npm install worked fine previously without explicitly listing react in every subpackage's devDependencies. They research pnpm documentation and learn that unlike npm, pnpm does not automatically install peer dependencies or hoist them to the root where they might be accidentally available. The strict-peer-dependencies setting defaults to true in pnpm 7\+, causing hard failures instead of warnings. The developer has two options: either explicitly add react and react-dom to each package's devDependencies where they are used as peers, or create a .npmrc file in the project root with strict-peer-dependencies=false to restore npm-like lenient behavior while keeping pnpm's other benefits. They choose to add the explicit dependencies for better long-term maintainability, and the install succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:41:34.854505+00:00— report_created — created