找不到Windows SDK 版本 10.0.22621.0

PS C:\Users\dgq\Downloads\spid-admin\spid-admin\node_modules\fibers> npx node-gyp build --msvs_version=2022
gyp info it worked if it ends with ok
gyp info using node-gyp@10.2.0
gyp info using node@16.13.2 | win32 | x64
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build\\binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]

C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: 找不
到
 Windows SDK 版本 10.0.22621.0。请安装所需版本的 Windows SDK,或者在项目属性页中或通过右键单击解决方案并选择“重定解决方案目标”来更改 SDK 版本。 [C:\Users\dgq\Downloads\spid-admin\spid-admin\node_m
odules\fibers\build\fibers.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1     
gyp ERR! stack at ChildProcess.<anonymous> (F:\my_java\mynpm\node_modules\node-gyp\lib\build.js:216:23)
gyp ERR! stack at ChildProcess.emit (node:events:390:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command "D:\\Java\\node-v16.13.2-win-x64\\node-v16.13.2-win-x64\\node.exe" "F:\\my_java\\mynpm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--msvs_version=2022"
gyp ERR! cwd C:\Users\dgq\Downloads\spid-admin\spid-admin\node_modules\fibers
gyp ERR! node -v v16.13.2
gyp ERR! node-gyp -v v10.2.0
gyp ERR! not ok

在这里插入图片描述
根据你提供的最新错误信息:

error MSB8036: 找不到 Windows SDK 版本 10.0.22621.0。
请安装所需版本的 Windows SDK,或者在项目属性页中或通过右键单击解决方案并选择“重定解决方案目标”来更改 SDK 版本。

这意味着系统找不到 Windows SDK 版本 10.0.22621.0,这是你构建项目所需要的 SDK 版本。

解决方法:

  1. 安装 Windows SDK 版本 10.0.22621.0

    • 请确保安装了 Windows SDK 10.0.22621.0。你可以通过 Visual Studio Installer 来安装该版本的 SDK。
      • 打开 Visual Studio Installer
      • 找到 Visual Studio Build Tools 并点击 修改
      • 单独安装工具 选项卡中,找到并勾选 Windows 10 SDK (版本 10.0.22621.0),然后点击 修改 进行安装。

    另外,你也可以直接从 Microsoft SDK 下载中心 获取该版本 SDK。在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

  2. 修改项目的 SDK 版本
    如果你不想安装此特定版本的 SDK,或者已经安装了不同版本的 SDK,可以通过修改项目的配置来使用已安装的 SDK 版本。

    打开 fibers.vcxproj 文件,在其中添加或修改 WindowsTargetPlatformVersion,确保它指向你已经安装的 SDK 版本。

    例如,修改为:

    <PropertyGroup>
      <WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
    </PropertyGroup>
    

在这里插入图片描述

你可以根据你的 SDK 版本来修改这个值(例如,如果你安装了10.0.19041.0,那么就用这个版本)。

  1. 检查 Visual Studio 安装和配置

    • 确保 Visual Studio 2022Build Tools 安装正确,并且包含了所需的 C++ 工具和 SDK。
    • 如果你没有安装 C++ 工具,可以通过 Visual Studio Installer工作负载 中选择 Desktop development with C++,确保安装了所有必需的工具。
  2. 重新运行构建命令
    安装 SDK 并确保配置正确后,重新运行构建命令:

    npx node-gyp build --msvs_version=2022
    

如果你仍然遇到问题,请告诉我,你是否已经安装了 SDK,或者是否需要更多帮助来修改项目文件配置。

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值