build(deps): drop node-gyp-build workaround via tweakcc 4.3.2 - #45
Open
bman654 wants to merge 1 commit into
Open
build(deps): drop node-gyp-build workaround via tweakcc 4.3.2#45bman654 wants to merge 1 commit into
bman654 wants to merge 1 commit into
Conversation
node-lief 1.3.2 removed the runtime `require('node-gyp-build')` entirely — its
`lib/index.js` now requires the platform prebuild by path and the package
declares no runtime dependencies at all. That retires the direct
`node-gyp-build` dependency clodex carried purely to work around node-lief
1.3.1, which had demoted it to a devDependency while still requiring it at
runtime (surfacing as "Failed to extract JavaScript from native installation").
Bumps tweakcc 4.3.0 -> 4.3.2 and moves the transitive node-lief pin 1.3.0 ->
1.3.2. Both are younger than the 10-day `minimumReleaseAge` guard, so the
lockfile was refreshed with a deliberate one-shot
`--config.minimumReleaseAge=0`; the repo-wide setting is unchanged and CI
installs with `--frozen-lockfile`.
tweakcc's exported API surface is unchanged between 4.3.0 and 4.3.2 (identical
apart from minifier renaming), so `src/tweakcc.d.ts` stays accurate. Verified
end to end against a real native install: `tryDetectInstallation` +
`readContent` extracted 21.6M chars of JS — the exact operation that failed
under the 1.3.1 packaging bug.
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.
Summary
clodex patchloadstweakcc, which pulls innode-liefto unpack and repack the native Claude Codebinary. clodex has been carrying a direct
node-gyp-builddependency that no clodex source imports,purely to work around node-lief 1.3.1: that release demoted
node-gyp-buildto a devDependency whileits runtime loader still
required it, so fresh end-user installs got a node-lief that threwCannot find module 'node-gyp-build'. tweakcc's lazy loader swallowed that into a null, and clodexsurfaced it as the misleading
Failed to extract JavaScript from native installation.node-lief 1.3.2 removes the
node-gyp-buildrequire entirely —lib/index.jsnow requires theplatform prebuild by path, and the package declares no runtime
dependenciesat all. The workaround isno longer needed, so this drops it.
tweakcc4.3.0 → 4.3.2node-lief1.3.0 → 1.3.2node-gyp-builddependencyCLAUDE.mdand the header comment insrc/tweakcc.d.tsFreshness guard
Both new versions are younger than the repo's 10-day
minimumReleaseAgesupply-chain guard(tweakcc 4.3.2 published 2026-07-20, node-lief 1.3.2 published 2026-07-23), so the lockfile was refreshed
with a deliberate one-shot
pnpm install --config.minimumReleaseAge=0, pluspnpm update node-lief --config.minimumReleaseAge=0— an ordinary install will not move a transitivepin that is already in the lockfile.
The repo-wide setting is unchanged. CI installs with
--frozen-lockfile, so these now-locked versionsinstall fine while the 10-day guard stays in force for every future resolution.
CLAUDE.mddocuments thisas the sanctioned escape hatch so the next person doesn't weaken the setting instead.
API-surface re-verification
CLAUDE.mdrequires re-verifyingsrc/tweakcc.d.tswhenever the tweakcc pin moves, because tweakccdeclares a
typesfield but ships no.d.ts. 4.3.2 still ships no.d.ts, and itsdist/lib/index.mjsexport list is byte-identical to 4.3.0's (backupFile,findAllInstallations,readContent,restoreBackup,tryDetectInstallation,writeContent, …). Thecontent-*.mjschunk thatimplements
tryDetectInstallation/readContent/writeContentdiffers only by minifier variablerenaming (16171 vs 16172 bytes). The existing shim remains accurate; no changes were needed beyond the
version in its comment.
Residual risk
tweakcc still declares
node-lief: ^1.3.0, and a published package'soverridesdo not apply to itsconsumers — so clodex cannot force end users onto ≥ 1.3.2. Anyone resolving exactly 1.3.1 (only reachable
now via a stale lockfile or cache, since 1.3.2 supersedes it) would see the old failure again.
CLAUDE.mdrecords this and says to restore the direct
node-gyp-builddependency if it ever shows up in the wild.Test plan
pnpm typecheck— cleanpnpm test— 79 files, 889 tests passing (run with an isolatedCLODEX_HOME)pnpm build— succeedsnode-gyp-buildpresent,tryDetectInstallationresolved the installed native Claude Code 2.1.219 andreadContentextracted 21,636,065 chars of JS — the exact operation that fails under the 1.3.1 packaging bug
node-gyp-buildno longer appears anywhere inpnpm-lock.yaml