您好,我在 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”]。您可以在 launch.json 中设置“runtimeExecutable”其中之一,或提供浏览器可执行文件的绝对路径。”
按照建议,我将runtimeExecutable添加到chrome可执行文件中,如下所示:
runtimeExecutable:“/opt/google/chrome/google-chrome”,现在错误消息显示:
无法附加到浏览器。
我的机器上安装的 Google Chrome 版本:83.0.4103.116-1。
提前感谢您的帮助
您也需要添加
webroot
属性,试试这个
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "${workspaceFolder}/index.html",
"webRoot": "${workspaceFolder}"
},
Html 站点无法在 vsc 中工作。有或没有调试器