【发布时间】:2020-06-27 13:06:39
【问题描述】:
您好,我在 VS Code 中直接运行 Chrome 调试器时遇到问题。我正在研究 Linux Mint。这就是我的 launch.json 文件的样子:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"file": "${workspaceFolder}/index.html"
}
]
}
现在我尝试运行调试器并显示错误消息:无法启动浏览器:“无法找到稳定的 Chrome 版本。可用的自动发现版本是:[“dev”]。您可以在启动时设置“runtimeExecutable” .json 到其中之一,或提供浏览器可执行文件的绝对路径。”
根据我的建议,我已将 runtimeExecutable 添加到 chrome 可执行文件中,如下所示:
runtimeExecutable:"/opt/google/chrome/google-chrome" 现在错误消息说:
无法附加到浏览器。
Google Chrome 安装在我的机器版本:83.0.4103.116-1。
提前感谢您的帮助
【问题讨论】:
-
你安装了 chrome 调试器吗?
pwa-chrome是什么?它应该是chrome如果你安装了 chrome 调试器 -
是的,我当然安装了 chrome 调试器扩展。当涉及到 pwa-chrome 时,它是在安装扩展后在 launch.json 文件中自动生成的。我也尝试使用值 chrome,但随后连接尝试在 localhost 而不是本地文件上执行。
标签: javascript visual-studio-code linux-mint chrome-debugging