chromium version error in path
Hey Playwright creators! 👋
I'm running into a frustrating issue with Playwright and Chromium, and I could really use some help. Here's what's going on:
The Error:
The Situation:
- Playwright is looking for Chromium in
/home/webapp/.cache/ms-playwright/chromium-1117/chrome-linux/chrome
- But I actually have Chromium installed at /home/webapp/.cache/ms-playwright/chromium-1140/chrome-linux/chrome
My Question:
How the hell can I specify which Chromium version Playwright should use? 🤔
I don't want to specify this in ENV since I want it to work out of the box and use playwright version that it install
Any help would be greatly appreciated. I'm pulling my hair out over here! 😫
Thanks in advance!9 Replies
View post on community site
This post has been pushed to the community knowledgebase. Any replies in this thread will be synced to the community site.
Apify Community
foreign-sapphire•7mo ago
Hey,
running
npx playwright install --with-deps
should fix this - it will install the correct version of chrome that playwright expects.
You may also try to update your playwright
dependency, chromium-1117
is pretty old, the latest playwright uses chromium-1142
GitHub
playwright/packages/playwright-core/browsers.json at main · microso...
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API. - microsoft/playwright
other-emeraldOP•7mo ago
@ondro_k I cannot run this command since I’m running it on AWS EC2 -> elasticbeanstalk which use Fedora underneath
Playwright support only Ubuntu (—with-deps will run apt command underneath - Ubuntu package manager)
Fedora (therefore Amazon Linux 2, uses yum as package manager)
I already installed in other script all packages that are installed with —with-deps flag)
foreign-sapphire•7mo ago
aaah, I see. Can you try to run
npx playwright install
(without --with-deps
)? I tested it on my Fedora and it worked. It still uses ubuntu binaries but it should work fine even on Fedora:
other-emeraldOP•7mo ago
But I don’t have issue with installing chromium
I have problem that playwright is looking for directory called chromium-1117 (I develop on windows machine and npx plawright install chromium —with-deps download chromium-1117 - I guess it’s the newest version for windows)
And when I run npx playwright install chromium on Linux it will download the newest one for Linux which is chromium-1140
So this is my issue that my playwright code is looking for chromium version that is the newest on windows and not Linux
foreign-sapphire•7mo ago
just to make sure...is your
package.json
and package-lock.json
same on both machines?other-emeraldOP•7mo ago
Of course… why? @ondro_k
foreign-sapphire•7mo ago
it looks like you're using different playwright versions...if you run
npx playwright --version
, do you get the same versions on both machines?
I think playwrigh uses same browser version for all OSes...what I would do is to remove node_modules
and .cache/ms-playwright/*
, then run npm install
and then npx playwright install
and it should install the same chromium versionother-emeraldOP•7mo ago
I figure out what was the issue - my pipelines - it was “npm I —no-package-lock” which updated node_modules and then I did npx playwright install which installed newer version and my build wanted to use the older
@ondro_k what was exactly what I did the day before you answer 😄 thank you for your help this can be marked as answer