Playwright version vs @playwright/test mismatch in CI
Each Playwright release pins a specific browser build. If playwright and @playwright/test resolve to different versions, or the cached browsers were downloaded by another version, the library looks for a revision that was never installed.
What this error means
The launch reports an "Executable doesn't exist" path with a browser revision number that does not match what npx playwright install downloaded, or a warning that the CLI and test package versions differ.
Error: browserType.launch: Executable doesn't exist at
/root/.cache/ms-playwright/chromium-1124/chrome-linux/chrome
Note: The Playwright package version (1.44.0) does not match the installed
browsers built for an earlier version. Run 'npx playwright install'.Common causes
playwright and @playwright/test are on different versions
A stray direct dependency on playwright pins an older version than @playwright/test, so the two disagree on which browser revision to use.
A stale browser cache from a prior version
A restored cache holds the browser build of the previous Playwright release, not the revision the upgraded library expects.
How to fix it
Align the versions and reinstall browsers
- Pin
@playwright/test(and remove a redundant directplaywrightdep, or match it). - Run
npx playwright installso the correct browser revision downloads. - Invalidate any browser cache keyed on the old version.
npm install -D @playwright/test@1.44.0
npx playwright install --with-depsKey the browser cache on the Playwright version
Bake the resolved version into the cache key so an upgrade forces a fresh browser download.
- uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: pw-${{ hashFiles('package-lock.json') }}How to prevent it
- Depend on one Playwright version through
@playwright/test, not both packages. - Run
playwright installin the same step that installs the library. - Include the Playwright version in the browser cache key.