追踪器:错误 TRK0005:无法定位:"CL.exe"

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

我觉得我什么都试过了。

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

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

我已尝试在 google 上找到的所有 "solution" 讨论或描述此问题的内容。

当我运行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.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 pro"。

CL.exe是VS的命令行构建。我会看几件事:

  1. 当你安装 VS 时,CL 安装是可选的,如果是的话,它是否打开?
  2. 环境变量。参见 https://msdn.microsoft.com/en-us/library/kezkeayy.aspx

我尝试安装 Visual Studio 2015。但我仍然看到此错误。后来发现安装的时候一定要选择Custom Install,SelectVisual C++

确保 "Platform Toolset" 在项目属性 > 常规设置下设置为您正在使用的正确 Visual Studio 版本。

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

您可能还想确认属性下的其他设置,如 "Windows SDK Version",并确保它已安装。您可以在 "Apps & Features" 下检查您的 Visual Studio 安装并修改。

今天我在构建新的 'Hello World' 控制台应用程序时遇到了类似的问题。我查看了 属性 页面(查看 - 其他 Windows - 属性 管理器)在 Microsoft.Cpp.Win32.user 。在 Common Properties - VC++ Directories - Executable Directories 结果表明 'Inherit from parent or project defaults' 没有被选中。检查发现 cl.exe 后。

我遇到了同样的问题。当我使用 visual studio 2015 而不是 2019 并将 windows SDK 版本从 10.0 更改为 8.1 时,问题得到了解决。