由于缺少 Windows 8.1 SDK,无法安装 Canvas 1.6.13

由于缺少 Windows 8.1 SDK,无法安装 Canvas 1.6.13

我正在尝试安装 Canvas 以便安装 chartjs-node,但每次尝试时都会出现此错误:

C:\Users\Mark\Desktop\Bot>npm install [email protected]

> [email protected] install C:\Users\Mark\Desktop\Bot\node_modules\canvas
> node-gyp rebuild


C:\Users\Mark\Desktop\Bot\node_modules\canvas>if not defined npm_config_node_gyp (node "D:\Node\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "D:\Node\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
 MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Mark\D
esktop\Bot\node_modules\canvas\build\canvas.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Node\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "D:\\Node\\node.exe" "D:\\Node\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Mark\Desktop\Bot\node_modules\canvas
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

我安装了 microsoft build tools 2017 以及实际的 windows 8.1 sdk,但它仍然不起作用。

相关内容