Skip to content

node: Fix missing bins with pnpm v12 - #560

Merged
bbhtt merged 2 commits into
flatpak:masterfrom
creeperkatze:pnpm-v12-bins
Oct 22, 2026
Merged

bbhtt merged 2 commits into
flatpak:masterfrom
creeperkatze:pnpm-v12-bins

Conversation

@creeperkatze

Copy link
Copy Markdown
Contributor

Since pnpm 12.4.1, an offline install from a generated store links no bins. pnpm now reads bin from the manifest in the store index instead of each package's package.json, and the generator only writes name and version there. So node_modules/.bin stays empty, and scripts fail with errors like Command "vite" not found.

The generator now copies the manifest fields pnpm keeps in its own store index (bin, dependencies, engines, os/cpu/libc, …) from each package's package.json.

It also adds a test and a README note for pnpm v12: use --pnpm-store-version v11, and install with --trust-lockfile. Without that flag, pnpm checks the lockfile against the registry and fails offline with ERR_PNPM_NO_OFFLINE_META.

Follow-up to #555 / #559.

@creeperkatze
creeperkatze requested a review from bbhtt as a code owner October 5, 2026 16:11
@github-actions github-actions Bot added the node label Oct 5, 2026

_SANITIZE_RE = re.compile(r'[\\/:*?"<>|]')
_MAX_LENGTH_WITHOUT_HASH = 120
_MANIFEST_FIELDS = (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the source of these fields? Is there any documentation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're the package.json fields pnpm keeps in its store index, from normalizeBundledManifest.ts: https://github.com/pnpm/pnpm/blob/27be1a9a5aa7e7728443545ce1ccfce619212074/pnpm11/store/cafs/src/normalizeBundledManifest.ts

I synced the list with it and added a comment explaining where they come from.

@bbhtt
bbhtt merged commit 880230d into flatpak:master Oct 22, 2026
4 checks passed
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