https://github.com/nodejs/node-gyp/issues/2203

https://stackoverflow.com/questions/57541402/node-gyp-configure-got-gyp-err-find-vs/63311413#63311413

https://www.jianshu.com/p/e2f12fab2b78

node版本12.22, win10

执行npm install报错信息如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.1974) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - missing any Windows SDK
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (D:\Software\nvm\v12.22.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at D:\Software\nvm\v12.22.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (D:\Software\nvm\v12.22.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at D:\Software\nvm\v12.22.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at D:\Software\nvm\v12.22.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at D:\Software\nvm\v12.22.0\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at D:\Software\nvm\v12.22.0\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1022:16)
gyp ERR! System Windows_NT 10.0.19044
  • 解决办法
  1. 以管理员运行cmd
  2. npm install --g --production windows-build-tools
  • 如果出现Successfully installed Python 2.7卡住了的情况,解决办法如下
  1. 在资源管理中搜索%temp%,window系统win+R搜索就可以
  2. 在搜索到的文件夹%temp%中创建dd_client_.log文件,并且填入内容Closing installer. Return code: 3010.