You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已设置firefoxExecutable,Visual Studio Code仍无法找到Firefox?

VS Code调试Firefox找不到可执行文件的原因及修复

导致VS Code无法识别Firefox路径的核心问题有两个:

  • JSON路径未转义:JSON字符串里的反斜杠\是转义字符,你配置里写的C:\Program Files\Mozilla Firefox\firefox会被解析成错误路径,必须把反斜杠改成双反斜杠\\,或者换成正斜杠/。
  • 缺少可执行文件后缀:Windows系统下Firefox的启动程序是firefox.exe,你只写了firefox,系统找不到对应的可执行文件。

修正后的配置代码如下:

{
  "name": "Mappings localhost",
  "type": "firefox",
  "request": "launch",
  "reAttach": true,
  "url": "http://localhost:4200/index.html",
  "pathMappings": [{
      "url": "http://localhost:4200/",
      "path": "${workspaceFolder}"
  }],
  "firefoxExecutable": "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
  "firefoxArgs": ["-start-debugger-server=6000"]
}

另外还可以排查这两点:

  • 确认Firefox确实安装在C:\Program Files\Mozilla Firefox目录下,如果是自定义安装路径,要同步修改配置里的路径。
  • 检查VS Code的「Debugger for Firefox」插件是否为最新版本,旧版本可能存在路径解析的兼容性问题。

内容的提问来源于stack exchange,提问作者user18928007

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 08:03:02