npm配置集msvs_version不工作,我仍然得到msvs_version not set from command line or npm config
。
我设置了所有必要的路径,并安装了VisualStudio2017、2019和2022以及必要的C++ thingys。
完全错误:
gyp info using node-gyp@6.1.0
gyp info using node@16.17.0 | win32 | x64
gyp info find Python using Python version 3.10.7 found at "C:\Python310\python.exe"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS running in VS Command Prompt, installation path is:
gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS - will only use this version
gyp ERR! find VS unknown version "undefined" found at "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS checking VS2019 (16.11.32901.82) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - does not match this Visual Studio Command Prompt
gyp ERR! find VS checking VS2019 (16.11.32901.82) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.18362.0
gyp ERR! find VS - does not match this Visual Studio Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.2094) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
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 checking VS2017 (15.9.28307.2094) 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 - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - does not match this Visual Studio Command Prompt
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 looking for Visual Studio 2013
gyp ERR! find VS - not found
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
发布于 2022-09-22 17:31:40
固定
我发现了导致这个error
npm uninstall <dependency-name>
npm install <dependency-name> -save-dev
.的devDependency
这解决了我现在的问题,但我不知道这是否是一个长期的解决方案,我可能会更新这个答案,当我达到打包应用程序的阶段。
https://stackoverflow.com/questions/73810105
复制相似问题