Skip to content

fix/node: git hoisted dependencies are rejected by pnpm - #556

Merged
bbhtt merged 1 commit into
flatpak:masterfrom
YUCLing:fix/pnpm-store-hoisted-deps
Sep 12, 2026
Merged

bbhtt merged 1 commit into
flatpak:masterfrom
YUCLing:fix/pnpm-store-hoisted-deps

Conversation

@YUCLing

@YUCLing YUCLing commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

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, pnpm
assumes 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: true dependency
(e.g. @electron/node-gyp) now fails.

This emits requiresPrepare for URL tarballs, derived from the tarball's
own 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

@YUCLing
YUCLing requested a review from bbhtt as a code owner September 10, 2026 13:47
@github-actions github-actions Bot added the node label Sep 10, 2026
@YUCLing
YUCLing force-pushed the fix/pnpm-store-hoisted-deps branch from 3a1308a to 9dd669a Compare September 11, 2026 01:47
@bbhtt
bbhtt merged commit de2225a into flatpak:master Sep 12, 2026
6 of 7 checks passed
@YUCLing
YUCLing deleted the fix/pnpm-store-hoisted-deps branch September 14, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants