chromium version error in path
# crawlee-js
w
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:
Copy code
Error processing batch: 
"errorName": "BrowserLaunchError",
"errorMessage": "Failed to launch browser. Please check the following:
- Try installing the required dependencies by running `npx playwright install --with-deps` (https://playwright.dev/docs/browsers).

The original error is available in the `cause` property. Below is the error received when trying to launch a browser:

browserType.launchPersistentContext: Executable doesn't exist at /home/webapp/.cache/ms-playwright/chromium-1117/chrome-linux/chrome
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!
h
message has been deleted
o
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](https://github.com/microsoft/playwright/blob/main/packages/playwright-core/browsers.json)
chromium-1142
w
@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)
o
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:
Copy code
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ubuntu20.04-x64.
w
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
o
just to make sure...is your
package.json
and
package-lock.json
same on both machines?
w
Of course… why? @ondro_k
o
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 version