Skip to content

Conversation

@xxairsky
Copy link
Contributor

@xxairsky xxairsky commented Nov 12, 2025

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
} else if (versionYear === 2022) {
return 'v143'
} else if (versionYear === 2026) {
return 'v145'
Copy link
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
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
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