在 VS Code 中运行 Chrome 调试器的问题 [英] Problem to run chrome debugger in VS Code
问题描述
我在 VS Code 中直接运行 Chrome 调试器时遇到了问题.我正在研究 Linux Mint.
Hi I've got a problem to run Chrome Debugger directly in VS Code. I'm working on Linux Mint.
现在我尝试运行调试器,错误消息说:无法启动浏览器:无法找到稳定的 Chrome 版本.可用的自动发现版本是:[dev"].您可以设置runtimeExecutable"在您的 launch.json 中添加到其中之一,或提供浏览器可执行文件的绝对路径."
Now i try to run debugger and error message says: Unable to launch browser: "Unable to find Chrome version stable. Available auto-discovered versions are: ["dev"]. You can set the "runtimeExecutable" in your launch.json to one of these, or provide an absolute path to the browser executable."
按照建议,我将 runtimeExecutable 添加到 chromeExecutable,现在错误是:
Following the sugesstion I've added runtimeExecutable to chromeExecutable and now the error is:
无法附加到浏览器.
我的机器上安装了谷歌浏览器版本:83.0.4103.116-1.
Google Chrome is installed on my machine version: 83.0.4103.116-1.
提前感谢您的帮助
错误:
当前配置:
推荐答案
1. Type chrome://version/ in Chrome browser.
2. Notice you will get some thing like this :::
谷歌浏览器 :: 86.0.4240.80(官方版本)(x86_64)
Google Chrome :: 86.0.4240.80 (Official Build) (x86_64)
修订 :: 7ed88b53bda45a2d19efb4f8706dd6b6cad0d3af-refs/branch-heads/4240@{#1183}
Revision :: 7ed88b53bda45a2d19efb4f8706dd6b6cad0d3af-refs/branch-heads/4240@{#1183}
操作系统 :: macOS 版本 10.15.7(内部版本 19H2)
OS :: macOS Version 10.15.7 (Build 19H2)
JavaScript :: V8 8.6.395.10
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
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
User Agent :: 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
Command Line :: /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
Executable Path :: /Applications/Chrome.app/Contents/MacOS/Google Chrome
配置文件路径 ::/Users/shivamgupta/Library/Application Support/Google/Chrome/Default
Profile Path :: /Users/shivamgupta/Library/Application Support/Google/Chrome/Default
变化 :: 84085631-ab02a1cf dff70c3e-377be55a ......,.
Variations :: 84085631-ab02a1cf dff70c3e-377be55a .......,.
复制可执行路径到runTimeExecutable
Copy the Executable Path to 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"
}
]
这篇关于在 VS Code 中运行 Chrome 调试器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!