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

2024-05-06

最近在 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}"
        }
    ]
}

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

Thanks!


是的,您需要更改配置才能启动 Edge 进行调试。您可以参考this doc https://code.visualstudio.com/docs/nodejs/browser-debugging#_launch-configuration。你需要改变type to pwa-msedge:

"type": "pwa-msedge",
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

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

随机推荐