在Windows 10的WSL Ubuntu上安装Cypress

11

我正在尝试在 Windows 10 上的 WSL Ubuntu 上设置 Cypress。WSL Ubuntu 没有自己的显示器,因此在设置 Cypress 之前,我们需要遵循一些步骤。我按照这里博客中提到的所有步骤进行操作:https://nickymeuleman.netlify.app/blog/gui-on-wsl2-cypress 但是我一直收到以下错误:

Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.

----------


(Cypress:1690): Gtk-WARNING **: 10:15:51.766: cannot open display: 183.87.117.18:0.0

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 4.6.0

我也在 Windows 10 上安装了 XLaunch。 之前有人能够解决这个问题吗?请问有人可以帮助我解决吗?

谢谢


你已经解决了这个问题吗? - Ernesto Alfonso
希望这个问题可以得到解决 https://github.com/cypress-io/cypress/issues/21095 - ohrlando
2个回答

1

从这里得到了灵感:https://github.com/microsoft/WSL/issues/4106#:~:text=you%20may%20also%20need%20to%20launch%20vcxsrv%20with%20the%20-ac%20argument

如果您正在运行XLaunch,请通过在任务栏上双击图标并单击“退出”来退出;

然后打开开始菜单>右键单击XLaunch快捷方式>更多>打开文件位置;

在资源管理器窗口中右键单击XLaunch快捷方式>属性;

在目标字段的结束双引号后面添加“ -ac”(不带双引号)- 即对我而言是"C:\Program Files\VcXsrv\xlaunch.exe" -ac;

点击确定

现在再次运行Cypress。耶!我成功运行了 :)


0

对我来说,这是由于拥有 WSL1 镜像(尽管已安装 WSL2)引起的。您可以通过 wsl --list --verbose 进行检查。按照此处的步骤转换为 WSL2。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接