node-gyp: Windows 11 SDK (10.0.22000) is not supported
-
Node Version: 16.11.1
-
Platform: OS Name: Microsoft Windows 11 Pro OS Version: 10.0.22000 N/A Build 22000 System Type: x64-based PC
-
Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133 msbuild: 16.11.1.47101 cl: 19.29.30136
-
Module: winax
Verbose output (from npm or node-gyp):
231 error code 1
232 error path d:\0\node_modules\winax
233 error command failed
234 error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
235 error gyp info it worked if it ends with ok
235 error gyp info using node-gyp@7.1.2
235 error gyp info using node@16.11.1 | win32 | x64
235 error gyp info find Python using Python version 3.10.0 found at "e:\sdk\python\python.exe"
235 error gyp ERR! find VS
235 error gyp ERR! find VS msvs_version was set from command line or npm config
235 error gyp ERR! find VS - looking for Visual Studio version 2019
235 error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
235 error gyp ERR! find VS checking VS2019 (16.11.31729.503) found at:
235 error gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
235 error gyp ERR! find VS - found "Visual Studio C++ core features"
235 error gyp ERR! find VS - found VC++ toolset: v142
235 error gyp ERR! find VS - missing any Windows SDK
235 error gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
235 error gyp ERR! find VS looking for Visual Studio 2015
235 error gyp ERR! find VS - not found
235 error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
235 error gyp ERR! find VS
235 error gyp ERR! find VS valid versions for msvs_version:
235 error gyp ERR! find VS
235 error gyp ERR! find VS **************************************************************
235 error gyp ERR! find VS You need to install the latest version of Visual Studio
235 error gyp ERR! find VS including the "Desktop development with C++" workload.
235 error gyp ERR! find VS For more information consult the documentation at:
235 error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
235 error gyp ERR! find VS **************************************************************
235 error gyp ERR! find VS
235 error gyp ERR! configure error
235 error gyp ERR! stack Error: Could not find any Visual Studio installation to use
235 error gyp ERR! stack at VisualStudioFinder.fail (d:\0\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
235 error gyp ERR! stack at d:\0\node_modules\node-gyp\lib\find-visualstudio.js:74:16
235 error gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (d:\0\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
235 error gyp ERR! stack at d:\0\node_modules\node-gyp\lib\find-visualstudio.js:70:14
235 error gyp ERR! stack at d:\0\node_modules\node-gyp\lib\find-visualstudio.js:372:16
235 error gyp ERR! stack at d:\0\node_modules\node-gyp\lib\util.js:54:7
235 error gyp ERR! stack at d:\0\node_modules\node-gyp\lib\util.js:33:16
235 error gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5)
235 error gyp ERR! stack at ChildProcess.emit (node:events:390:28)
235 error gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
235 error gyp ERR! System Windows_NT 10.0.22000
235 error gyp ERR! command "e:\\sdk\\nodejs\\node.exe" "d:\\0\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
235 error gyp ERR! cwd d:\0\node_modules\winax
235 error gyp ERR! node -v v16.11.1
235 error gyp ERR! node-gyp -v v7.1.2
235 error gyp ERR! not ok
236 verbose exit 1
node-gyp/lib/find-visualstudio.js#getSDK
could not recognize Microsoft.VisualStudio.Component.Windows11SDK.22000
in info.packages
because the pattern const win10SDKPrefix = 'Microsoft.VisualStudio.Component.Windows10SDK.'
doesn’t match.
my info.packages
contrains
...
'Microsoft.VisualStudio.Component.Windows11SDK.22000',
'Win11SDK_10.0.22000',
...
'Microsoft.VisualStudio.Component.Windows10SDK',
...
After I changed this line https://github.com/nodejs/node-gyp/blob/master/lib/find-visualstudio.js#L184
to ret.sdk = '10'
node-gyp configure
and node-gyp build
could run successfully.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (11 by maintainers)
Commits related to this issue
- fix: update node-gyp package this fixes missing SDK build error on windows see https://github.com/nodejs/node-gyp/issues/2527 — committed to Debenben/noble by Debenben 2 years ago
- fix: update node-gyp package this fixes missing SDK build error on windows see https://github.com/nodejs/node-gyp/issues/2527 — committed to abandonware/noble by Debenben 2 years ago
Yes I did. Here is the extract from my .npmrc file:
msvs_version=2022
I agree to @NyaomiDEV that this is not a problem of MSVS, but a problem of the Windows SDK. MSVS 2022 is found, but the latest Windows SDK for Windows 11 is not detected as the log output clearly states:
When I install the latest Windows SDK for Windows 10, everything works as expected.
While I do understand your request, I must say, it is clear as day that the code will not find the Windows 11 SDK because the package prefix changed a
10
into an11
as I already said; but it won’t prevent building on Windows 11 because, as of right now, the Windows 10 SDK is still installed by default when people install the “Desktop development with C++” or “Visual C++ build tools” workloads. In fact, I was building just fine and I caused myself this problem when I uninstalled my copy of the Windows 10 SDK because I felt like upgrading to the Windows 11 one.Full logs and commands typed are, therefore, useless to this scope. You could run your
lib/Find-VisualStudio.cs
file like the project does and then try to find the Windows 10 package prefix to ultimately notice that it is gone on an installation that only provides the Windows 11 SDK. (I did this to notice the shortcoming)But, with patience, I will upgrade to the latest node-gyp and post the full logs in the coming days.
@ShenHongFei Please try again on v8.4.0
node-gyp v8.4.0
Features
Not up to date.
node-sass is deprecated so we cannot offer support for it.