Skip to content

Commit accafa7

Browse files
mschmickingclaude
andcommitted
Fix Windows CI on Node 20 and 22 by using a current node-gyp
The windows-latest image ships Visual Studio 18. The node-gyp bundled with npm on Node 20 and 22 does not recognise it and fails configure with 'find VS unknown version "undefined"'; Node 24 already carries a new enough node-gyp, which is why only those two cells failed. Install node-gyp@latest on Windows runners and point npm at it. Also document the same workaround for users, who hit this whenever they pair Node 20 or 22 with Visual Studio 2026. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 0073e1b commit accafa7

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ jobs:
2525
with:
2626
node-version: ${{ matrix.node }}
2727

28+
# The node-gyp bundled with npm on Node 20 and 22 cannot detect Visual
29+
# Studio 18, which is what the windows-latest image now ships, and bails
30+
# with 'unknown version "undefined"'. Node 24 already carries a new enough
31+
# node-gyp. Point npm at a current one so every Node version can build.
32+
- name: Use a current node-gyp on Windows
33+
if: runner.os == 'Windows'
34+
run: |
35+
npm install -g node-gyp@latest
36+
npm config set node_gyp "$(npm prefix -g)/node_modules/node-gyp/bin/node-gyp.js"
37+
2838
# Compiles the addon along with the vendored Lua and LuaFileSystem sources.
2939
- name: Install and build
3040
run: npm install

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ The addon is compiled at install time, so you need a working C/C++ toolchain:
2121
Nothing else. Earlier versions needed you to build and install LuaJIT yourself on Linux; that is
2222
no longer the case.
2323

24+
> **Windows with Visual Studio 2026:** the `node-gyp` bundled with Node.js 20 and 22 cannot detect
25+
> that version and fails with `find VS unknown version "undefined"`. Node.js 24 is unaffected. On
26+
> Node 20 or 22, point npm at a current node-gyp:
27+
>
28+
> ```
29+
> npm install -g node-gyp@latest
30+
> npm config set node_gyp "%APPDATA%\npm\node_modules\node-gyp\bin\node-gyp.js"
31+
> ```
32+
2433
## Quick start
2534
2635
```javascript

0 commit comments

Comments
 (0)