{"record":{"id":"c35db6374a79a5da","repo":"nodejs/node","slug":"s-requires-any-sdk-of-s-version-but-none-were-f","errorCode":null,"errorMessage":"%s requires any SDK of %s version, but none were found","messagePattern":"(.+?) requires any SDK of (.+?) version, but none were found","errorType":"exception","errorClass":"GypError","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/generator/msvs.py","lineNumber":2986,"sourceCode":"        else:\n            properties[0].append([\"ApplicationType\", \"Windows Store\"])\n\n    platform_name = None\n    msvs_windows_sdk_version = None\n    for configuration in spec[\"configurations\"].values():\n        platform_name = platform_name or _ConfigPlatform(configuration)\n        msvs_windows_sdk_version = (\n            msvs_windows_sdk_version\n            or _ConfigWindowsTargetPlatformVersion(configuration, version)\n        )\n        if platform_name and msvs_windows_sdk_version:\n            break\n    if msvs_windows_sdk_version:\n        properties[0].append(\n            [\"WindowsTargetPlatformVersion\", str(msvs_windows_sdk_version)]\n        )\n    elif version.compatible_sdks:\n        raise GypError(\n            \"%s requires any SDK of %s version, but none were found\"\n            % (version.description, version.compatible_sdks)\n        )\n\n    if platform_name == \"ARM\":\n        properties[0].append([\"WindowsSDKDesktopARMSupport\", \"true\"])\n\n    return properties\n\n\ndef _GetMSBuildConfigurationDetails(spec, build_file):\n    properties = {}\n    for name, settings in spec[\"configurations\"].items():\n        msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file)\n        condition = _GetConfigurationCondition(name, settings, spec)\n        character_set = msbuild_attributes.get(\"CharacterSet\")\n        vctools_version = msbuild_attributes.get(\"VCToolsVersion\")\n        config_type = msbuild_attributes.get(\"ConfigurationType\")","sourceCodeStart":2968,"sourceCodeEnd":3004,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/generator/msvs.py#L2968-L3004","documentation":"Raised as a GypError during MSBuild project generation when no installed Windows SDK matches the version required by the configured MSVS toolchain. The generator iterates configurations looking for a WindowsTargetPlatformVersion; if none resolves and the toolchain declares compatible_sdks, it errors because the build cannot proceed without an SDK.","triggerScenarios":"Generating MSBuild projects with an MSVS version that declares compatible_sdks, on a machine where none of those SDK versions are installed, and no msvs_windows_target_platform_version is explicitly set. Falls through to the `elif version.compatible_sdks` branch at msvs.py:2986.","commonSituations":"Fresh CI/dev machine without the Windows SDK installed; upgrading the MSVS toolchain version without installing the matching SDK; targeting a Windows SDK that was uninstalled; mismatch between the gyp-configured msvs_version and the installed SDKs.","solutions":["Install a Windows SDK matching the version.compatible_sdks requirement (shown in the message).","Pin the msvs_version / WindowsTargetPlatformVersion to an SDK that is installed.","On CI, add the required SDK to the image or install it in the setup step.","Verify with `reg query` or the installed SDKs list that the expected version is present."],"exampleFix":"# before — machine lacks the SDK for the default msvs version\ngyp --depth=. -f msvs -Gmsvs_version=2022\n# after — install matching SDK, or pin to installed version\ngyp --depth=. -f msvs -Gmsvs_version=2022 -Gmsvs_windows_target_platform_version=10.0.20348.0","handlingStrategy":"validation","validationCode":"import subprocess\nr = subprocess.run(['reg','query',r'HKLM\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots'], capture_output=True, text=True)\nif 'Windows Kits' not in r.stdout:\n    raise EnvironmentError('no Windows SDK installed')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the Windows SDK version matching your msvs_version.","Pin WindowsTargetPlatformVersion to an installed SDK.","Add the SDK to CI images."],"tags":["gyp","msvs","windows-sdk","environment","msbuild","windows"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}