Skip to content

fix(npm): add libc:glibc to linux-x64 and linux-arm64 packages (closes #116)#161

Merged
proggeramlug merged 1 commit intomainfrom
fix-116-linux-x64-packaging
Apr 23, 2026
Merged

fix(npm): add libc:glibc to linux-x64 and linux-arm64 packages (closes #116)#161
proggeramlug merged 1 commit intomainfrom
fix-116-linux-x64-packaging

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Summary

Fixes #116@perryts/perry on Linux x64 glibc fails with "The @perryts/perry-linux-x64 package is not installed".

Root cause

npm 9.4+ introduced the libc optional-dependency field. When any package in a cpu+os group carries an explicit libc selector (here: @perryts/perry-linux-x64-musl declares "libc": ["musl"]), npm 9.4+ expects the companion glibc package to also carry "libc": ["glibc"]. Without it, npm skips the untagged package on glibc systems, leaving no binary installed, and the perry.js wrapper throws:

[perry] The @perryts/perry-linux-x64 package is not installed.
Cannot find module '@perryts/perry-linux-x64/bin/perry'

The user's npm 11.3.0 is a clean glibc install — the selector mismatch is entirely on the package side. This is the same problem esbuild and Bun ran into when they added musl variants: their fix was to add "libc": ["glibc"] to the glibc packages, making the matrix symmetric.

Changes

  • npm/perry-linux-x64/package.json.tmpl: add "libc": ["glibc"]
  • npm/perry-linux-arm64/package.json.tmpl: add "libc": ["glibc"]

The musl templates already have "libc": ["musl"]. No other files changed.

Backwards compatibility: npm < 9.4 ignores the libc field entirely, so the change has no effect on older npm versions — both glibc and musl packages install on all Linux x64/arm64, and perry.js's isMusl() runtime check picks the right binary.

Action required after merge

A republish is needed. The currently-published @perryts/perry-linux-x64 and @perryts/perry-linux-arm64 on npmjs.com are missing the libc field. Triggering release-packages.yml (workflow_dispatch with publish_npm: true) against the current release tag will re-publish both packages with the corrected package.json.

Test plan

  • npm install @perryts/perry on glibc Linux x64 (Ubuntu/Debian) with npm ≥ 9.4 — @perryts/perry-linux-x64 should be selected and installed
  • npm install @perryts/perry on musl Linux x64 (Alpine) — @perryts/perry-linux-x64-musl should be selected; glibc package should be skipped
  • npm install @perryts/perry on glibc Linux arm64 — @perryts/perry-linux-arm64 should be selected
  • npm install @perryts/perry on npm < 9 (e.g. npm 8) on Linux x64 glibc — both glibc + musl packages install; wrapper picks glibc via isMusl() returning false

https://claude.ai/code/session_01U8z7eJFTmCu1LBxwzPjuty


Generated by Claude Code

npm 9.4+ uses the `libc` field for optional-dependency filtering. When one
package in a cpu/os group declares a `libc` (e.g. `perry-linux-x64-musl`
with `libc:["musl"]`), npm 9.4+ expects the companion glibc package to
also carry an explicit `libc:["glibc"]` — without it, glibc-x64 systems
receive neither package and the wrapper errors with "The
@perryts/perry-linux-x64 package is not installed".

Add `"libc": ["glibc"]` to the two affected templates. The musl packages
already have `"libc": ["musl"]`, so this makes the matrix symmetric.
npm < 9.4 ignores the libc field entirely, so the change is backwards
compatible.

NOTE: a republish is required to push packages with the corrected
package.json fields — the current @perryts/perry-linux-x64 and
@perryts/perry-linux-arm64 on npm are missing the field.

https://claude.ai/code/session_01U8z7eJFTmCu1LBxwzPjuty
@proggeramlug proggeramlug force-pushed the fix-116-linux-x64-packaging branch from 4781a52 to 7043756 Compare April 23, 2026 15:07
@proggeramlug proggeramlug merged commit 6905a9f into main Apr 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

not work on linux platform of the hello world

2 participants