fix(pkg): no-op install script so npm doesn't inject node-gyp rebuild#48
Merged
ShawnChen-Sirius merged 1 commit intoJun 17, 2026
Merged
Conversation
The native addon ships as prebuilt per-platform subpackages (@chdb/lib-<platform>, pulled via optionalDependencies and resolved by dist/loader.js); nothing is built on the user's machine. But the repo keeps a binding.gyp for dev builds, and when the package has a binding.gyp and no explicit install script, npm auto-injects 'install: node-gyp rebuild' into the published package. The tarball ships no binding.gyp or C++ sources (files whitelist), so that injected rebuild fails and 'npm install chdb' aborts. An explicit no-op install suppresses the injection. Affects the already-published 3.0.0 and 3.1.0-rc.1 (both carry the injected script) — they need patch republishes (3.0.1 / 3.1.0-rc.2) to become installable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
npm install chdbfails for both published versions (3.0.0 and 3.1.0-rc.1):Cause
The native addon ships as prebuilt per-platform subpackages (
@chdb/lib-<platform>, pulled viaoptionalDependencies, resolved at runtime bydist/loader.js) — nothing is built on the user's machine. But the repo keeps abinding.gypfor dev builds, and npm auto-injects"install": "node-gyp rebuild"into a published package when it sees abinding.gypand no explicit install script (the string is never in our source —git log -Sfinds it nowhere). Thefileswhitelist ships nobinding.gypor sources, so that injected rebuild has nothing to build and the install fails.Fix
Add an explicit no-op
install(node -e "") so npm stops injecting the default. Users get the addon from the subpackage; dev still builds vianpm run build.Verified with
npm pack: the tarball'sinstallis now the no-op andbinding.gypis absent.Follow-ups (not in this PR)
npm installthe packed tarball" check would have caught this.