已安装含MSBuild的VS2019,运行node-gyp仍报find VS错误求解
环境前置情况
- 已安装Visual Studio 2019,且安装包含MSBuild组件

问题触发过程
执行node-gyp configure --msvs_version=2019或node-gyp rebuild命令时,会抛出如下报错信息:
gyp info it worked if it ends with ok gyp info using node-gyp@7.1.2 gyp info using node@14.9.0 | win32 | x64 gyp info find Python using Python version 3.7.9 found at "C:\ProgramData\Anaconda3\python.exe" 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 could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details 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 gyp ERR! node -v v14.9.0 gyp ERR! node-gyp -v v7.1.2
待解决诉求
当前场景和过往公开渠道记录的node-gyp configure 报“gyp ERR! find VS”错误同类问题高度相似,但过往公开渠道给出的各类解决方案对当前环境均不生效,需要可落地的排查、解决方法。
内容的提问来源于stack exchange,提问作者Sepush
相关产品推荐
相关产品推荐

