Visual Studio Code - 无法启动浏览器:“无法在您的系统上找到浏览器的安装。”

Max*_*uso 9 browser visual-studio-code microsoft-edge

最近在 VS code 中运行脚本(我的任何 python、javascript、html...脚本)时出现了一个问题。出现一个弹出窗口:Visual Studio Code - Unable to launch Browser: "Unable to find an installation of the browser on your system.Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json.

我的浏览器是边缘浏览器。当我打开时,launch.json我发现它似乎正在尝试使用我没有在计算机上下载的 Chrome。

{
    // 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",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

我可以更改配置以匹配我计算机上运行的浏览器吗?或者我还能做些什么来解决这个问题?

谢谢!

Yu *_*hou 4

是的,您需要更改配置才能启动 Edge 进行调试。您可以参考这个文档。您需要更改typepwa-msedge

"type": "pwa-msedge",
Run Code Online (Sandbox Code Playgroud)