c++ - 追踪器 : error TRK0005: Failed to locate: "CL.exe"

标签 c++ node.js npm-install node-gyp

我觉得我什么都试过了。

  • 我已经安装和卸载了每个版本的 Visual 工作室(2010 - 2017)

  • 我尝试安装用于 windows c++ 的构建工具

  • 我已经卸载并重新安装了 node.js。

但是无论我做什么,我仍然会收到错误:

TRACKER : error TRK0005: Failed to locate: "CL.exe".

我已尝试在 google 上找到的所有讨论或描述此问题的“解决方案”。

当我运行 npm install

我收到以下错误:

    TRACKER : error TRK0005: Failed to locate: "CL.exe". file not found


gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xampp\htdocs\myproject\src\node_modules\node-expat
gyp ERR! node -v v6.11.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
learningbank@1.0.0 C:\xampp\htdocs\myproject\src
`-- (empty)

谁能告诉我如何解决这个问题?

我的操作系统是“Windows 10 专业版”。

最佳答案

确保在项目属性 > 常规设置下的“平台工具集”设置为您正在使用的正确 Visual Studio 版本。

在我的例子中,我从 GitHub 下载了一个设置为 Visual Studio 2015 的项目,我使用的是 VS 2017。更改后它起作用了。

您可能还想确认属性下的其他设置,如“Windows SDK 版本”,并确保已安装。您可以在“应用程序和功能”下检查您的 Visual Studio 安装并进行修改。

关于c++ - 追踪器 : error TRK0005: Failed to locate: "CL.exe",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45436035/

相关文章:

c++ - 维吉尼亚密码

c++ - 如何自定义 C++ 列表容器,使其可以容纳不同类型的结构?

python - 通过 Fabric 进行 npm 安装

javascript - ubunu 中的 Angular CLI 安装错误 - 当我尝试在我的 ubuntu 机器中运行 angular CLI 命令时出现错误

react-native - `react-native init app` 在 React-Native 0.56 中不起作用

c++ - 从txt文件C++读取浮点错误值

c++ - 简单程序由于某种原因崩溃

javascript - 如何在 fetch() 函数之后重定向

node.js - 附加到 winston 记录的最后一行

javascript - Nodejs 拼接 JSON 元素效果不佳