Skip to content

fix(npm): install a runnable binary on every Linux arch and libc - #1038

Merged
codyde merged 1 commit into
masterfrom
fix/npm-linux-targets
Aug 3, 2026
Merged

fix(npm): install a runnable binary on every Linux arch and libc#1038
codyde merged 1 commit into
masterfrom
fix/npm-linux-targets

Conversation

@codyde

@codyde codyde commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

npm i -g @railway/cli is broken on a large share of Linux hosts.

postinstall.js resolved the download target via @napi-rs/triples, which always answers *-unknown-linux-gnu for Linux. We only publish a gnu build for x86_64:

host today
linux/arm64, arm, ia32 install fails — Failed fetching the binary: Not Found
linux/x64 on musl installs, then won't run — Dynamic loader not found: /lib64/ld-linux-x86-64.so.2

That covers Graviton/Ampere, ARM CI runners, Docker on Apple Silicon, Raspberry Pi, and Alpine.

Changes

  • explicit platform/arch → triple map matching exactly what release.yml builds, with Linux on the static musl builds — the choice install.sh already makes deliberately ("use the statically compiled musl bins on linux to avoid linking issues")
  • unsupported platforms name what is supported instead of surfacing a bare 404
  • drop @napi-rs/triples
  • bin/railway.js no longer flattens every failure to exit 1. This is why agents.railway.com install fails silently in several common cases (segfault, set -e + whoami, sh vs bash) #990 reported "exits with code 1, no error message" for what was actually a crash.
child before after
exit 2 / 42 / 255 1 / 1 / 1 2 / 42 / 255
SIGSEGV / SIGINT 1 / 1 139 / 130
missing binary 1, no output 127 + how to fix

Verification — real npm i -g of the packed tarball on linux/amd64 and linux/arm64 × glibc (node:24) and musl (node:24-alpine), plus natively on darwin/arm64. All four Linux combinations failed before this change. Every mapped target confirmed to exist as a release asset.

🤖 Generated with Claude Code

postinstall.js resolved the download target via @napi-rs/triples, which always
answers `*-unknown-linux-gnu` for Linux. We only publish a gnu build for
x86_64, so:

- linux/arm64, linux/arm and linux/ia32 fail during install with "Failed
  fetching the binary: Not Found" — Graviton/Ampere, ARM CI runners, Docker on
  Apple Silicon, Raspberry Pi.
- linux/x64 on musl installs fine, then cannot execute at all: "Dynamic loader
  not found: /lib64/ld-linux-x86-64.so.2".

Replace it with an explicit platform/arch -> triple map covering exactly the
targets release.yml builds, with Linux on the static musl builds — the choice
install.sh already makes deliberately. Unsupported platforms now name what is
supported instead of surfacing a bare 404. Drops @napi-rs/triples.

Also stop bin/railway.js flattening every failure to exit 1, which is why #990
reported "exits with code 1, no error message" for what was actually a crash:

    exit 2/42/255   ->  2/42/255   (was 1/1/1)
    SIGSEGV/SIGINT  ->  139/130    (was 1/1)
    missing binary  ->  127 + remediation (was 1, no output)

Verified with a real `npm i -g` of the packed tarball on linux/amd64 and
linux/arm64, on glibc and musl, plus natively on darwin/arm64. All four Linux
combinations previously failed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codyde codyde added the release/patch Author patch release label Aug 3, 2026
@codyde
codyde merged commit f1393f6 into master Aug 3, 2026
7 checks passed
@codyde
codyde deleted the fix/npm-linux-targets branch August 3, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/patch Author patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant