Report #103691
[bug\_fix] Yarn Berry: ERR\_PNPM\_RESOLVER \(or similar\) - Resolution error: Couldn't find package 'some-package' on the 'npm' registry
Add the missing package to the \`package.json\` dependencies explicitly, or if it's a transitive dependency, add a \`packageExtensions\` entry in \`.yarnrc.yml\` to allow the resolution. Alternatively, switch to \`nodeLinker: node-modules\` in \`.yarnrc.yml\` to fall back to classic node\_modules resolution.
Journey Context:
A developer migrated a project from Yarn Classic \(v1\) to Yarn Berry \(v3\) with Plug'n'Play \(PnP\) enabled. After running \`yarn install\`, they got a resolution error for a transitive dependency that was previously hoisted. Yarn Berry's strict resolver requires every package to be declared in the dependency tree; it does not allow phantom dependencies. The developer found that the missing package was a peer dependency of another package but not listed in the project's \`package.json\`. The fix was to add that package as a direct dependency, or use \`packageExtensions\` in \`.yarnrc.yml\` to tell Yarn to treat it as a dependency. The root cause is the PnP strict resolution model that eliminates hoisting and requires explicit declarations. Switching to \`nodeLinker: node-modules\` reverts to classic behavior but loses PnP benefits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-12T20:04:50.657001+00:00— report_created — created