18

嗨,我在 VS Code 中直接运行 Chrome 调试器时遇到问题。我正在研究 Linux Mint。

现在我尝试运行调试器并显示错误消息:无法启动浏览器:“无法找到稳定的 Chrome 版本。可用的自动发现版本是:[“dev”]。您可以将 launch.json 中的“runtimeExecutable”设置为其中之一,或提供浏览器可执行文件的绝对路径。”

根据我的建议,我将 runtimeExecutable 添加到 chromeExecutable ,现在错误是:

无法附加到浏览器。

我的机器上安装了谷歌浏览器版本:83.0.4103.116-1。

提前感谢您的帮助

错误: 错误

当前配置: 当前配置

4

2 回答 2

20
1. Type chrome://version/ in Chrome browser.
2. Notice you will get some thing like this ::: 

Google Chrome :: 86.0.4240.80(官方版本)(x86_64)

修订:: 7ed88b53bda45a2d19efb4f8706dd6b6cad0d3af-refs/branch-heads/4240@{#1183}

操作系统:: macOS 版本 10.15.7(内部版本 19H2)

JavaScript :: V8 8.6.395.10

Flash :: 32.0.0.445 /Users/shivamgupta/Library/Application Support/Google/Chrome/PepperFlash/32.0.0.445/PepperFlashPlayer.plugin

用户代理:: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36

命令行:: /Applications/Chrome.app/Contents/MacOS/Google Chrome -psn_0_57358 --flag-switches-begin --flag-switches-end --restore-last-session

可执行路径:: /Applications/Chrome.app/Contents/MacOS/Google Chrome

配置文件路径:: /Users/shivamgupta/Library/Application Support/Google/Chrome/Default

变体:: 84085631-ab02a1cf dff70c3e-377be55a ....,.

将可执行路径复制到 runTimeExecutable

Now Copy this snippet in launch.json::
"configurations": [
    {
      "name": "Launch Chrome",
      "request": "launch",
      "type": "pwa-chrome",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}/public",
      "runtimeExecutable": "/Applications/Chrome.app/Contents/MacOS/Google Chrome"
    }
]
于 2020-10-21T18:48:26.310 回答
15

我也有同样的问题。并找到了如何设置

debug.javascript.usePreview: false in VS settings

在此处输入图像描述

于 2020-07-15T08:41:49.500 回答