fix(cli): package native npm binaries#42
Conversation
| "postinstall": "node scripts/install.js || true" | ||
| "build": "node scripts/build-binaries.js", | ||
| "prepack": "npm run build", | ||
| "postinstall": "node scripts/install.js" |
There was a problem hiding this comment.
🟡 Removing || true from postinstall causes hard failure on unsupported platforms
The postinstall script was changed from "node scripts/install.js || true" to "node scripts/install.js". On unsupported platforms (e.g., FreeBSD, s390x), getPlatformSuffix() at packages/cli/scripts/install.js:30-34 calls process.exit(1) when the platform/arch isn't in the mapping. Without || true, this causes the entire npm install relayfile to fail. Previously, the || true catch-all allowed npm install to succeed even when the binary couldn't be installed, letting users see a clear error only at runtime. Now the package is completely uninstallable on any platform not in the 6 pre-built targets. While the packaged-binary happy path works for supported platforms, the process.exit(1) in getPlatformSuffix should be replaced with a graceful warning + process.exit(0) so npm install doesn't abort.
Prompt for agents
The postinstall script changed from `node scripts/install.js || true` to `node scripts/install.js`. This means any `process.exit(1)` in install.js will now fail `npm install` entirely. The specific problem is in `packages/cli/scripts/install.js` in the `getPlatformSuffix()` function (lines 30-34), which calls `process.exit(1)` on unsupported platforms. The fix should be in install.js rather than restoring `|| true` — change the unsupported platform handling to log a warning and exit(0) gracefully, so npm install succeeds but the user is told the CLI binary isn't available for their platform. This keeps failures visible for real errors while being tolerant of unsupported platforms.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Verification