Skip to content

Commit 69e5fd2

Browse files
authored
feat: Support for Visual Studio 2026 (18.x)
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. Fixes #3228 #3221 #3214
1 parent 641b220 commit 69e5fd2

File tree

4 files changed

+1243
-13
lines changed

4 files changed

+1243
-13
lines changed

lib/find-visualstudio.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class VisualStudioFinder {
119119
}
120120

121121
async findVisualStudio2019OrNewerFromSpecifiedLocation () {
122-
return this.findVSFromSpecifiedLocation([2019, 2022])
122+
return this.findVSFromSpecifiedLocation([2019, 2022, 2026])
123123
}
124124

125125
async findVisualStudio2017FromSpecifiedLocation () {
@@ -162,7 +162,7 @@ class VisualStudioFinder {
162162
}
163163

164164
async findVisualStudio2019OrNewerUsingSetupModule () {
165-
return this.findNewVSUsingSetupModule([2019, 2022])
165+
return this.findNewVSUsingSetupModule([2019, 2022, 2026])
166166
}
167167

168168
async findVisualStudio2017UsingSetupModule () {
@@ -223,7 +223,7 @@ class VisualStudioFinder {
223223
// Invoke the PowerShell script to get information about Visual Studio 2019
224224
// or newer installations
225225
async findVisualStudio2019OrNewer () {
226-
return this.findNewVS([2019, 2022])
226+
return this.findNewVS([2019, 2022, 2026])
227227
}
228228

229229
// Invoke the PowerShell script to get information about Visual Studio 2017
@@ -389,6 +389,10 @@ class VisualStudioFinder {
389389
ret.versionYear = 2022
390390
return ret
391391
}
392+
if (ret.versionMajor === 18) {
393+
ret.versionYear = 2026
394+
return ret
395+
}
392396
this.log.silly('- unsupported version:', ret.versionMajor)
393397
return {}
394398
}
@@ -456,6 +460,8 @@ class VisualStudioFinder {
456460
return 'v142'
457461
} else if (versionYear === 2022) {
458462
return 'v143'
463+
} else if (versionYear === 2026) {
464+
return 'v145'
459465
}
460466
this.log.silly('- invalid versionYear:', versionYear)
461467
return null

0 commit comments

Comments
 (0)