Skip to content

feat: Support for Visual Studio 2026 (18.x) to enable node-gyp to work with the latest Visual Studio preview and release versions. - #3240

Merged
lukekarrys merged 1 commit into
nodejs:mainfrom
xxairsky:main
Nov 12, 2025
Merged

lukekarrys merged 1 commit into
nodejs:mainfrom
xxairsky:main

Conversation

@xxairsky

@xxairsky xxairsky commented Nov 12, 2025 •

Copy link
Copy Markdown
Contributor
Checklist
  • npm install && npm run lint && npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

Add support for Visual Studio 2026 (18.x) to enable node-gyp to work with the latest Visual Studio preview and release versions.

Changes made:

  1. Version Recognition: Added mapping for versionMajor 18 → versionYear 2026 in getVersionInfo() function
  2. Toolset Support: Updated toolset mapping to use v145 for VS2026 (confirmed from Microsoft documentation)
  3. Path Compatibility: Support both installation paths:
    • Insiders/Preview: C:\Program Files\Microsoft Visual Studio\18\Insiders
    • Release: C:\Program Files\Microsoft Visual Studio\2026\Community
  4. Test Coverage: Added comprehensive test cases for both VS2026 Insiders and Release variants
  5. Backward Compatibility: Maintained full compatibility with existing VS2017-2022 versions

Technical Details:

  • Updated lib/find-visualstudio.js with new version mappings
  • Added test fixtures: VS_2026_Insiders_workload.txt and VS_2026_Community_workload.txt
  • All existing tests continue to pass
  • Verified with real compilation in a native addon project

This change enables developers using Visual Studio 2026 to compile native Node.js addons without manual configuration.

feat: Add support for Visual Studio 2026 (18.x)

- Add versionMajor 18 mapping to versionYear 2026
- Update toolset to v145 for VS2026 (confirmed from MS docs)
- Support both Insiders (18\Insiders) and Release (2026\Community) installation paths
- Add comprehensive test coverage for both VS2026 variants
- Maintain backward compatibility with all existing VS versions

This enables node-gyp to work with Visual Studio 2026 Preview/Insiders and future 18.x releases.
@xxairsky xxairsky mentioned this pull request Nov 12, 2025
@xxairsky xxairsky changed the title Air feat: Add support for Visual Studio 2026 (18.x) to enable node-gyp to work with the latest Visual Studio preview and release versions. Nov 12, 2025
@xxairsky xxairsky changed the title feat: Add support for Visual Studio 2026 (18.x) to enable node-gyp to work with the latest Visual Studio preview and release versions. Added: Support for Visual Studio 2026 (18.x) to enable node-gyp to work with the latest Visual Studio preview and release versions. Nov 12, 2025
Comment thread lib/find-visualstudio.js
} else if (versionYear === 2022) {
return 'v143'
} else if (versionYear === 2026) {
return 'v145'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this version has not been updated in the doc yet: https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170#version-macros

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this version has not been updated in the doc yet: https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170#version-macros

Clearly, Microsoft's development team is far behind in terms of documentation update speed.

However, I can assure you that VS2026 uses version 145 and has passed rigorous unit and compilation tests.

My personal product has been successfully compiled and released using this PR. ;)

@legendecas legendecas changed the title Added: Support for Visual Studio 2026 (18.x) to enable node-gyp to work with the latest Visual Studio preview and release versions. feat: Support for Visual Studio 2026 (18.x) to enable node-gyp to work with the latest Visual Studio preview and release versions. Nov 12, 2025
@lukekarrys
lukekarrys merged commit 69e5fd2 into nodejs:main Nov 12, 2025
29 checks passed
OGMatrix added a commit to OGMatrix/mcmodding-mcp that referenced this pull request Aug 28, 2026
…ecompression with fallback

* feat: add zstd database compression and streamed native decompression

Add zstd compression in release and weekly workflows.

Add streamed native decompression with fallback for unsupported Node.js

* fix(zstd): resolve PR review feedback for node versioning, stream errors, and test guards

* fix: verify downloaded database integrity against manifest hash

- manage.ts: fetch the manifest before downloading, verify the temp
  file's SHA256 before installing (catches truncated or corrupted
  downloads, including silently-truncated zstd frames), and reuse the
  fetched manifest instead of a second network round-trip
- db-versioning.ts: clean up the partial .tmp file when a download or
  decompression fails so it cannot be mistaken for a valid database
- add tests: calculateFileHash unit tests plus integration tests for
  the zstd download path (skipped on runtimes without native zstd)

* fix(ci): exclude windows + Node 20 from test matrix

Node 20 is EOL and better-sqlite3 no longer ships prebuilds for it
(ABI 115), so the Windows cell compiles it from source. The node-gyp
bundled with pnpm cannot detect the VS 2026 (v18) toolchain on
windows-latest (VS 2026 support landed in node-gyp 12.1.0,
nodejs/node-gyp#3240, pnpm#10268). Node 20 remains covered on
Linux/macOS, where the source build works; all Node 22 cells install
from prebuilds.

* fix(tests): raise timeout for real LLM round-trip tests

The network-dependent tests in index.test.ts make real LLM/embedding
calls (embedding model init is slow in CI). One of them already had a
120s budget and still timed out on the windows-latest cell, and the
sibling LLM test took 92s in the same run. Give the four LLM-path
tests a 5-minute budget instead of the 60s default / 120s patch.

---------

Co-authored-by: OGMatrix <matrix@ogmatrix.net>
tnunamak added a commit to PDP-Connect/data-connect that referenced this pull request Sep 2, 2026
windows-latest's Visual Studio install moved to a bare "\18\" path
(VS 2026 naming). node-gyp bundled with Node 22.23.1's npm (10.9.8)
can't parse that version and fails better-sqlite3's native build
with `unknown version "undefined" found at ... \18\Enterprise`.

Tried pinning a modern node-gyp (>=12.1.0, which added VS2026/18.x
detection per nodejs/node-gyp#3240) via npm_config_node_gyp first,
but npm's run-script hardcodes its own bundled node-gyp for
automatic native rebuilds during `npm ci` and ignores that config
(npm/cli#2839) — confirmed live: the env var was set but the
rebuild still used node-gyp 11.5.0 and failed identically.

Pin to windows-2022 instead, whose Visual Studio install predates
this naming change, until actions/setup-node's Node 22 LTS bundles
npm>=11.6.3.

Fixes #47

Assisted-by: AI
Signed-off-by: Tim Nunamaker <tnunamak@gmail.com>
tnunamak added a commit to PDP-Connect/data-connect that referenced this pull request Sep 3, 2026
windows-latest now ships a Visual Studio install under a bare
"\18\" path (VS 2026's naming scheme). The node-gyp bundled with
Node 22.23.1's npm (10.9.8) predates VS18 detection support and
fails better-sqlite3's native build with
`unknown version "undefined" found at ... \18\Enterprise`.

Install node-gyp>=12.1.0 (nodejs/node-gyp#3240 added VS2026/18.x
detection) globally on the Windows leg only, and point npm at it
via npm_config_node_gyp, so node-gyp is resolved before any `npm
ci` triggers a native build.

Fixes #47

Assisted-by: AI
Signed-off-by: Tim Nunamaker <tnunamak@gmail.com>
tnunamak added a commit to PDP-Connect/data-connect that referenced this pull request Sep 3, 2026
windows-latest's Visual Studio install moved to a bare "\18\" path
(VS 2026 naming). node-gyp bundled with Node 22.23.1's npm (10.9.8)
can't parse that version and fails better-sqlite3's native build
with `unknown version "undefined" found at ... \18\Enterprise`.

Tried pinning a modern node-gyp (>=12.1.0, which added VS2026/18.x
detection per nodejs/node-gyp#3240) via npm_config_node_gyp first,
but npm's run-script hardcodes its own bundled node-gyp for
automatic native rebuilds during `npm ci` and ignores that config
(npm/cli#2839) — confirmed live: the env var was set but the
rebuild still used node-gyp 11.5.0 and failed identically.

Pin to windows-2022 instead, whose Visual Studio install predates
this naming change, until actions/setup-node's Node 22 LTS bundles
npm>=11.6.3.

Fixes #47

Assisted-by: AI
Signed-off-by: Tim Nunamaker <tnunamak@gmail.com>
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.

3 participants