Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\A

1,102 阅读1分钟

问题描述: [X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

image.png

提示没有设置CHROME_EXECUTABLE 找到自己的Chrome安装位置 设置路径

image.png

运行flutter doctor 还是有问题

[X] Chrome - develop for the web (Cannot find chrome executable at C:\Program Files \Google\Chrome\Application)
    ! C:\Program Files \Google\Chrome\Application is not executable.

测试: 运行flutter devices 会输出一个设备,该设备会在运行您的应用的情况下打开 浏览器,并输出一个提供为应用提供服务的网址的设备。

1 connected devices:
Edge (web)   • edge   • web-javascript • Microsoft Edge 97.0.1072.62

显示连接 Microsoft Edge浏览器,因为我电脑的默认浏览器是 Microsoft Edge。 实在是不清楚是不是这个原因,反正我更改了自己的默认浏览器为Chrome

image.png

然后再将CHROME_EXECUTABLE的值精确到Chrome.exe

重启计算机

运行flutter doctor