{"schemaVersion":"1.0","canonicalUrl":"https://automationtester.in/failures/playwright-browser-executable-missing","slug":"playwright-browser-executable-missing","title":"Playwright browser executable doesn't exist","searchTitle":"Playwright: Executable doesn't exist","signature":"Error: browserType.launch: Executable doesn't exist at","description":"Error: browserType.launch: Executable doesn't exist at <path> means the browser build this Playwright version pins is not installed where it looks.","frameworks":["Playwright","CI"],"classification":"dependency","summary":"Playwright went to launch the exact browser build its own version pins, and nothing was at that path. No test step ran, so the fix is in how the job installs or locates browsers, not in the spec.","repro":{"versions":["@playwright/test 1.62.1","macOS, arm64"],"files":[{"path":"playwright.config.ts","language":"ts","code":"import { defineConfig } from \"@playwright/test\"\n\nexport default defineConfig({ testDir: \"./tests\" })"},{"path":"tests/launch.spec.ts","language":"ts","code":"import { test, expect } from \"@playwright/test\"\n\ntest(\"browser launches\", async ({ page }) => {\n  await page.setContent(\"<h1>ok</h1>\")\n  await expect(page.getByRole(\"heading\")).toHaveText(\"ok\")\n})"}],"command":"PLAYWRIGHT_BROWSERS_PATH=\"$PWD/empty\" npx playwright test --reporter=list","output":"# <scratch> is the run's working directory, shortened here\n  ✘  1 tests/launch.spec.ts:3:5 › browser launches (1ms)\n\n    Error: browserType.launch: Executable doesn't exist at <scratch>/empty/chromium_headless_shell-1234/chrome-headless-shell-mac-arm64/chrome-headless-shell\n    ╔════════════════════════════════════════════════════════════╗\n    ║ Looks like Playwright was just installed or updated.       ║\n    ║ Please run the following command to download new browsers: ║\n    ║                                                            ║\n    ║     npx playwright install                                 ║\n    ║                                                            ║\n    ║ <3 Playwright Team                                         ║\n    ╚════════════════════════════════════════════════════════════╝","ran":"locally","ranOn":"2026-10-23"},"causes":[{"title":"The browsers were never installed in this job","explanation":"Installing @playwright/test from npm gives you the runner, not the browsers: none of the Playwright packages has an install script that downloads them. Playwright's browser guide says each version needs specific browser binaries and that you install them with the Playwright CLI. A fresh runner that only ran npm ci has nothing at the path.","diagnostic":"Run `npx playwright install --dry-run chromium` in the failing job. It prints the build this version expects (chromium-headless-shell v1234 for 1.62.1) and its install location. List that directory.","fix":"Add `npx playwright install --with-deps chromium` after the dependency install and before the tests, in the same job and as the same user."},{"title":"A cache or Docker image was built for another Playwright version","explanation":"The directory name carries the build number, so browsers installed for one release are invisible to the next. We pointed 1.62.1 at a browsers path holding only build 1228 and it still asked for chromium_headless_shell-1234. A restored ms-playwright cache keyed on anything but the Playwright version does the same, and so does an mcr.microsoft.com/playwright image whose tag differs from the project's version.","diagnostic":"Compare the build number in the error path with the directories in the browsers path. In a container, compare the image tag with `npx playwright --version`.","fix":"Pin the image tag to the exact Playwright version in the lockfile. If you cache browsers at all, key the cache on that version. Playwright's CI guide advises against caching them, because a restore takes about as long as a download."},{"title":"Install and run see different browser paths","explanation":"The default location sits under the user's home directory (~/.cache/ms-playwright on Linux, ~/Library/Caches/ms-playwright on macOS), and PLAYWRIGHT_BROWSERS_PATH overrides it. Installing as root in a Dockerfile and running as another user, or exporting the variable in one step only, sends the launch to an empty directory. That is exactly what the repro does on purpose.","diagnostic":"Print HOME, the effective user and PLAYWRIGHT_BROWSERS_PATH in both the install step and the test step.","fix":"Set PLAYWRIGHT_BROWSERS_PATH once, at job or image level, or install as the user that runs the tests."},{"title":"Only the headless shell was installed, and the run needs full Chromium","explanation":"`--only-shell` skips the full Chromium download for jobs that only run headless. A headed run, or a project using the 'chromium' channel for Chromium's new headless mode, needs the chromium-<build> directory instead. With only chromium_headless_shell-1234 present, our spec passed headless and failed under --headed with Executable doesn't exist at …/chromium-1234/….","diagnostic":"Read the missing path: chromium_headless_shell-<build> and chromium-<build> are different installs.","fix":"Drop --only-shell, or use it only in jobs that never run headed or with the 'chromium' channel."}],"verifiedFix":{"summary":"Install the browser build that matches the Playwright version, in the job and as the user that runs the tests.","files":[{"path":".github/workflows/e2e.yml (steps)","language":"yaml","code":"- run: npm ci\n- run: npx playwright install --with-deps chromium\n- run: npx playwright test"}],"evidence":"Re-run on 2026-10-23 with @playwright/test 1.62.1 on macOS, arm64: `npx playwright install --dry-run chromium` named chromium-headless-shell v1234 under ~/Library/Caches/ms-playwright, and with PLAYWRIGHT_BROWSERS_PATH unset the same spec printed 1 passed (496ms). A browsers path holding only chromium_headless_shell-1228 still asked for the 1234 directory, and a path holding only the 1234 headless shell passed headless and failed under --headed. The workflow steps above follow Playwright's CI guide; they were not run on a hosted runner."},"notTheCause":[{"title":"Missing Linux libraries","explanation":"When the executable exists but its shared libraries do not, Playwright 1.62.1 reports Host system is missing dependencies to run browsers instead. That is the --with-deps half of the install, and a different error."},{"title":"The test, its timeout or its locators","explanation":"browserType.launch throws before the first test step; the repro failed in 1 ms. No change to the spec or to timeouts can affect it."},{"title":"A broken node_modules","explanation":"Deleting node_modules and running npm ci again reinstalls the runner and leaves the browsers directory exactly as it was."}],"prevention":["Install browsers in the job that runs the tests, with the version from the lockfile.","Keep the Playwright Docker image tag and the npm version in one place and bump them together.","Fail fast with `npx playwright install --dry-run` output in the log when a launch fails."],"related":["playwright-webserver-timeout","dependency-module-not-found"],"references":[{"label":"Playwright: Browsers (install, locations, --only-shell)","url":"https://playwright.dev/docs/browsers"},{"label":"Playwright: Continuous Integration, caching browsers","url":"https://playwright.dev/docs/ci"},{"label":"Playwright: Docker image version must match","url":"https://playwright.dev/docs/docker"},{"label":"Playwright source: registry/index.ts, where the message is built","url":"https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/registry/index.ts"}],"publishedAt":"2026-10-22","updatedAt":"2026-10-23"}