Report #58847
[bug\_fix] ERR\_PNPM\_PEER\_DEP\_ISSUES Unmet peer dependencies / .pnpmfile.cjs is required
Add the missing peer dependencies explicitly to your devDependencies: pnpm add --save-dev \[peer-package\]@\[version\], or disable strict checking by creating .npmrc with strict-peer-dependencies=false. Root cause: Unlike npm \(v7\+\) and yarn, pnpm does not automatically install peer dependencies by default. It enforces strict peer dependency validation, causing installation to fail if declared peers are not explicitly present in the project's dependencies, preventing 'phantom dependency' bugs where packages use undeclared peers that happen to be present by accident.
Journey Context:
Developer migrates a working React project from npm to pnpm for faster installs and disk efficiency. They delete node\_modules and package-lock.json, then run pnpm install. Instead of success, they get a red error: ERR\_PNPM\_PEER\_DEP\_ISSUES with a table showing unmet peer dependencies: react-dom@^18.0.0 and typescript@^4.0.0. Developer is confused because npm install worked perfectly. They check node\_modules and see that pnpm created a .pnpm directory but didn't install the peers. Searching the pnpm documentation, they learn that pnpm is strict about peer dependencies and does not auto-install them like npm v7\+ does. The developer has two options: manually add each missing peer to devDependencies \(pnpm add -D react-dom@18 typescript\), or relax the check by creating .npmrc with strict-peer-dependencies=false. Choosing the explicit route for reproducibility, they add the peers. Running pnpm install again succeeds because pnpm now sees the peer dependency constraints satisfied by explicit project dependencies, aligning with its strict resolution algorithm that prevents implicit peer usage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:15:55.540641+00:00— report_created — created