Open Newbie012 opened 1 year ago
Same thing here, using WSL.
Same here
Same here as well
Note that I can run GUI apps in WSL2 such as Gedit without any issues.
I manage to make it run with the following:
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/ npx playwright test
But modifying globally LD_LIBRARY_PATH breaks something in my WSL (apparently Golang executables). I don't know if it's my WSL or if it's "expected". I don't know enough yet on this kind of stuff.
I manage to make it run with the following:
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/ npx playwright test
But modifying globally LD_LIBRARY_PATH breaks something in my WSL (apparently Golang executables). I don't know if it's my WSL or if it's "expected". I don't know enough yet on this kind of stuff.
Interestingly enough, I have the same problem but on ubuntu 20.04 and this fixes the issue and I am able to run the tests.
Was having this same issue, if you use nvm
to manage your node versions in WSL2 (as I am), then removing the sudo
and just running npx playwright install-deps
should fix it.
Found this nugget in Microsoft's official guide to installing nvm
on WSL2, right after step 9:
If you are using NVM to install Node.js and NPM, you should not need to use the SUDO command to install new packages.
After that the tests ran without errors.
npx playwright install-deps
fix my problem. Thanks @ch4r-ch4r
npx playwright install-deps
still didn't work for me, but this setup did (API mode):
import { chromium } from "playwright";
const browser = await chromium.launch({
executablePath: chromium.executablePath(), // <- add this
headless: false,
});
If that doesn't work, you can try to install google chrome separately and provide it here. I used this for testing: https://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line
import { chromium } from "playwright";
const browser = await chromium.launch({
executablePath: "/usr/bin/google-chrome",
headless: false,
});
The window was not sized properly though to the viewport, I'm not sure if this is a problem on my end (I use this X410 bridge: https://www.microsoft.com/store/productId/9NLP712ZMN9Q)
npx playwright install-deps
fix my problem. Thanks @ch4r-ch4r
work for me, thanks
had the same issue on wsl2 with python playwright; I ran playwright install
without having first run playwright install-deps
Context:
System:
Binaries:
Languages:
npmPackages:
Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:
Describe the bug
While running the code above, I'm getting
Trying to follow the instructions leads to the same error: