可以通过配置tasks.json文件来解决这个问题。
具体方法如下:
1、按ctrl+shift+p打开命令面板,输入configure task然后依次操作
2、然后点击最后一个打开这个文件,进入到了tasks.json。我们可以看到默认配置如下:
{ // see https://go.microsoft.com/fwlink/?linkid=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "echo", "type": "shell", "command": "echo hello" } ]}
我们需要对这个代码进行修改,如下:
{ // see https://go.microsoft.com/fwlink/?linkid=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "run html file with chrome", "type": "process", "command": "chrome", "args": ["${file}"], "windows": { //这里写你电脑的chrome浏览器的安装位置 "command": "c:/program files (x86)/google/chrome/application/chrome.exe" }, "group": { "kind": "build", "isdefault": true } } ]}
保存后打开文件,按下ctrl+shift+b就能打开浏览器了。
相关文章教程推荐:vscode教程
以上就是vscode提示找不到chrome浏览器的解决方法的详细内容。
