Repository navigation
fix/node: git hoisted dependencies are rejected by pnpm - #556
Merged
Merged
Conversation
YUCLing
force-pushed
the
fix/pnpm-store-hoisted-deps
branch
from
September 11, 2026 01:47
3a1308a to
9dd669a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes offline installs of git-hosted dependencies on pnpm 11.25.0+.
pnpm 11.25.0 (pnpm/pnpm#14160) changed store reuse for git-hosted
tarballs: unless the store index row records
requiresPrepare, pnpmassumes the package may need a prepare step and refuses to reuse it,
falling back to a fetch — which fails in an offline build with
ERR_PNPM_NO_OFFLINE_TARBALL.
pnpm writes that field itself when it fetches such a package. The v11
store populator doesn't, so any cached
gitHosted: truedependency(e.g. @electron/node-gyp) now fails.
This emits
requiresPreparefor URL tarballs, derived from the tarball'sown package.json using the same rule pnpm applies (packageShouldBeBuilt),
so it is false only when the package genuinely has nothing to prepare.
That accuracy matters: #14160 is an approval check, and the marker is
what tells pnpm "these stored files were never prepared by anyone".
The field is optional and the record is self-describing, so pnpm versions
that don't read it are unaffected. Registry entries are unchanged.
The change is tested with pnpm v11.25.0 with my project's lockfile (uses
@electron/node-gyp).Also tested with pnpm v11.20.0 to make sure it doesn't break the older
versions.
This PR was assisted by DeepSeek V4.1 Flash