Skip to content

Fix Windows npm install failure: bump @electron/rebuild to 4.2.0 - #505

Open
benlohlohloh wants to merge 1 commit into
chaitanyagiri:mainfrom
benlohlohloh:fix/electron-rebuild-windows-build
Open

benlohlohloh wants to merge 1 commit into
chaitanyagiri:mainfrom
benlohlohloh:fix/electron-rebuild-windows-build

Conversation

@benlohlohloh

Copy link
Copy Markdown

This fixes npm install failing on Windows when building native modules (e.g. better-sqlite3).

Problem

The pinned @electron/rebuild@^3.7.0 pulls in a forked node-gyp (10.2.0-electron.1) that, when using the ClangCL toolset, generates a librarian invocation with /LTCG:INCREMENTAL. llvm-lib.exe doesn't understand that flag and fails with:

error MSB6006: "llvm-lib.exe" exited with code 1.
...
/LTCG:INCREMENTAL: no such file or directory

This blocks npm install from completing on a clean Windows machine with the Clang/LLVM MSVC toolset installed.

Fix

Bump @electron/rebuild to ^4.2.0, which the Electron team already fixed by switching from the broken forked node-gyp back to the standard node-gyp@^12.2.0 package (see electron/electron#47613).

Testing

  • Reproduced the failure on a clean Windows 11 machine with Node v24.19.0 and VS Build Tools 2022 + ClangCL component installed.
  • After bumping the version and regenerating package-lock.json via npm install, the ClangCL/LTCG failure no longer occurs.

🤖 Generated with Claude Code

The pinned ^3.7.0 pulled in a forked node-gyp (10.2.0-electron.1) that
emits /LTCG:INCREMENTAL for the ClangCL toolset's librarian, which
llvm-lib.exe doesn't support, breaking `npm install` on Windows when
compiling native deps like better-sqlite3. Electron fixed this
upstream in @electron/rebuild 4.2.0 by switching back to standard
node-gyp ^12.2.0.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚫 This PR is missing its before/after evidence

Every pull request here has to show its work. Screenshots or a short screen recording, before the change and after it.

  • Before — no image or video under that heading
  • After — no image or video under that heading

How to fix it: edit the description, keep the ### Before and ### After headings from the template, and drag an image or video under each. GitHub uploads it inline. This check re-runs the moment you save.

A bug fix with no visible surface still needs it: show the failing behaviour, then the same steps passing. A terminal recording is fine.

Genuinely nothing to show — a CI tweak, a typo, a dependency bump? A maintainer can apply the no-visual-change label. Please don't ask unless it truly has no observable effect.

📖 CONTRIBUTING.md → Evidence is mandatory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant