【问题标题】:npm config set msvs_version does not work? (node-gyp)npm config set msvs_version 不起作用? (节点gyp)
【发布时间】:2022-09-23 01:31:40
【问题描述】:

npm config set msvs_version 不起作用,我仍然得到msvs_version not set from command line or npm config

我已经设置了所有必要的路径,并且安装了 Visual Studio 2017、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

    标签: c++ node.js visual-studio npm node-gyp


    【解决方案1】:

    固定的


    • 我找到了导致此错误的依赖项
    • 使用npm uninstall <dependency-name>卸载它
    • 我使用 npm install <dependency-name> -save-dev 重新下载了它作为 devDependency。

    这暂时解决了我的问题,但我不知道这是否是一个长期的解决方案,当我进入打包应用程序的阶段时,我可能会更新这个答案。

    【讨论】:

      猜你喜欢
      • 2014-04-18
      • 2023-03-23
      • 2020-02-22
      • 1970-01-01
      • 2019-01-01
      • 1970-01-01
      • 2014-05-28
      • 1970-01-01
      • 2023-02-07
      相关资源
      最近更新 更多