【问题标题】:Use node-gyp with atom将 node-gyp 与 atom 一起使用
【发布时间】:2020-05-04 21:52:44
【问题描述】:

我看过很多关于使用 node.js 运行 c++ 文件的教程。这些教程中的大多数都使用名为node-gyp 的包。我试图通过 npm 安装这个

npm i node-gyp -g

它有效。当我使用以下配置 node-gyp 时会出现问题:

node-gyp configure

当我使用这个命令时,它会抛出这个错误:

gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.13.1 | win32 | x64
gyp info find Python using Python version 3.8.0 found at "...Path to Python"
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
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 **************************************************************
//more error stuff

我正在使用 atom,如果我可以在没有 vscode 的情况下使用它,我会应用它。

【问题讨论】:

    标签: node.js atom-editor node-gyp


    【解决方案1】:

    Visual Studio Code 和 Visual Studio 尽管名称相似,但它们是完全不相关的产品。如错误日志中所述,您需要安装与node-gyp(“Visual Studio 2017 或更高版本”)兼容的 Visual Studio 版本。这种依赖的原因是 Visual Studio 中包含的 C/C++ 编译器。免费的community edition 应该足以让您继续前进。

    【讨论】:

      猜你喜欢
      • 2017-11-06
      • 2014-12-04
      • 2017-12-02
      • 2018-01-08
      • 2014-02-13
      • 2011-06-02
      • 2013-04-24
      • 2015-11-08
      • 1970-01-01
      相关资源
      最近更新 更多