如何修复 "Failed to connect to localhost port 9515: Connection refused" Laravel Dusk

How to fix "Failed to connect to localhost port 9515: Connection refused" Laravel Dusk

所以我已经和 Laravel Dusk 一起工作了大约几个月了。但是突然运行报错:

Failed to connect to localhost port 9515: Connection refused

我知道这是一个非常常见的错误,我用谷歌搜索了很多都没有找到解决方案,因为它们似乎都在使用 homestead。

我的设置: Windows 10 个使用 WSL。 我正在使用 VSCode 到 运行 测试使用 php artisan dusk --stop-on-error --stop-on-failure

我没有找到任何与 Windows 10 相关的解决方案,而没有 homestead 我没有使用。

完整的错误输出是:

1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"w3c":false,"binary":"","args":["--disable-gpu","--headless","--window-size=1920,1080"]}}}

Failed to connect to localhost port 9515: Connection refused

我相信这与 chromedriver 无法正常工作有关,因为它甚至似乎没有启动,但我对这个说法并不准确。我预计 dusk 会 运行 测试失败,因为我没有设置测试通过。

非常感谢任何帮助或指导,因为我很困!

所以对于任何想知道为什么它不起作用的人。对我来说,这是我自己的愚蠢。几天前我试图 运行 使用 geckodriver 的 firefox 并给出了错误的 exe 文件的错误路径,因此根本无法服务...