docs(install): document Bun install and improve missing-binary error#418
Conversation
Bun does not run dependency lifecycle scripts by default, so the npm wrapper's postinstall (which fetches the native Zero binary from GitHub Releases) is silently skipped. The first run then fails with an unhelpful "No native binary found" message that points at a source-only build command, leaving Bun users stuck. Add a Bun section to README.md and docs/INSTALL.md with the two working install paths (run postinstall.mjs manually, or add the package to the project's trustedDependencies). Rewrite the wrapper's missing-binary error to give an actionable fix for everyone and a Bun-specific hint when run under Bun, instead of only suggesting a source checkout.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR adds Bun-specific remediation guidance for the missing native binary scenario. ChangesBun Install Remediation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thank you for Zero and everything else! ✨ keep shipping big!
|
Summary
Installing
@gitlawb/zerowith Bun silently skips the wrapper'spostinstall, so the native binary is never fetched and the first run fails with:That message only helps someone with a source checkout — a Bun user who just ran
bun addis left stuck. This PR makes Bun a documented install path and makes the error actionable for everyone.Why this happens
Bun is "default-secure" and does not run lifecycle scripts of installed dependencies by default — only the installing project's own scripts.
@gitlawb/zeroisn't on Bun's built-intrustedDependencieslist, so thepostinstallinscripts/postinstall.mjs(which downloads the platform binary from GitHub Releases) is skipped with no warning.npm/yarnrun it, so the documentednpm install -g @gitlawb/zeroflow works; only Bun users hit this.Refs: bun.sh/docs/cli/install, bun.sh/docs/pm/lifecycle
Changes
README.md— new### Bunsubsection under Install with the two working install paths.docs/INSTALL.md— new## Bunsection with the same, plus a link to Bun's lifecycle docs.bin/zero.js— rewrote the missing-binary error to:No native binary found next to the npm wrapperlead line (so the Go wrapper test atinternal/npmwrapper/npmwrapper_test.go:259still passes),scripts/postinstall.mjsmanually (concrete fix that works for any package manager), andprocess.versions.bun/buninexecPath), append a Bun-specific note pointing attrustedDependencies.go run ./cmd/zerorather thango run ./cmd/zero-release build(the latter only makes sense inside a release checkout).Verification
node --check bin/zero.js✓node(generic path) and underbun(Bun-specific hint appears) ✓go test ./internal/npmwrapper/ ./internal/release/✓ (all pass, includingTestNodeWrapperReportsMissingNativeBinary)Notes / possible follow-ups
optionalDependenciespackages (esbuild/sharp style), which removes the reliance on apostinstallentirely and works under Bun withouttrustedDependencies. That's a bigger change and out of scope here; this PR is the minimal docs + error-message fix.Summary by CodeRabbit
Documentation
Bug Fixes