This is a minimal, customer-independent reproduction of a pnpm bug in a
single-package project using node-linker=hoisted.
After pnpm creates a normal install, pnpm recursive install --prod fails while
reconstructing the production dependency graph. The equivalent non-recursive
pnpm install --prod succeeds.
Requirements: npm/npx and internet access. The runner downloads the selected
Node and pnpm versions and creates disposable state under .work/.
bash reproduce.shThe default is Node 22.14.0 with pnpm 10.34.5. To test another pnpm version:
bash reproduce.sh 9.4.0
bash reproduce.sh 11.22.0Exit status 0 means the exact bug reproduced and the non-recursive workaround
succeeded. Exit status 2 means the recursive command succeeded, so the bug was
not present for that pnpm version.
The failing command reports:
ERR_PNPM_MISSING_HOISTED_LOCATIONS @opentelemetry/core@2.9.0(@opentelemetry/api@1.9.1) is not found in hoistedLocations inside node_modules/.modules.yaml
Inside a clean copy of this directory:
pnpm install --prod=false --no-frozen-lockfile
pnpm recursive install --prodExpected: the second command should complete successfully.
Actual on affected pnpm versions: the second command fails with
ERR_PNPM_MISSING_HOISTED_LOCATIONS even though this is not a workspace and the
equivalent pnpm install --prod succeeds.
Tested on macOS arm64 with Node 22.14.0:
| pnpm | Result |
|---|---|
| 9.4.0 | Reproduces |
| 9.15.9 | Reproduces |
| 10.15.1 | Reproduces |
| 10.34.5 | Reproduces |
| 11.22.0 | Does not reproduce |
| 11.23.0 | Does not reproduce |
This appears related to
pnpm issue #6584, but that report
requires a workspace with shared-workspace-lockfile=false. This reproduction
uses a single package, fails specifically through the recursive command, and
continues to fail on the latest pnpm 10 release tested.
Upstream report: pnpm/pnpm#14131