Skip to content
Latchkey

Playwright "Host system is missing dependencies to run browsers" in CI

Playwright downloaded the browser but the runner image does not have the system libraries (libnss3, libatk, libgbm and friends) the browser links at launch. Running npx playwright install --with-deps installs both the browser and those OS packages.

What this error means

A test run aborts before any test with "Host system is missing dependencies to run browsers" and a list of missing libraries, usually on a slim Linux container rather than the ubuntu-latest GitHub image.

playwright
Host system is missing dependencies to run browsers.
Missing libraries:
    libnss3.so
    libatk-1.0.so.0
    libatk-bridge-2.0.so.0
    libgbm.so.1
Please install them with the following command:
    npx playwright install-deps

Common causes

Browsers installed without their OS dependencies

A bare npx playwright install fetches the browser binaries but not the apt packages they need, so the dynamic linker fails at launch on a minimal image.

A slim base image that omits GUI/runtime libraries

Containers like node:20-slim or node:20-alpine strip the libraries (libnss3, libgbm, libasound2) that headless Chromium and Firefox still load.

How to fix it

Install browsers with their system dependencies

Use the --with-deps flag so Playwright installs the apt packages alongside the browser binaries.

Terminal
npx playwright install --with-deps

Use the official Playwright container image

The mcr.microsoft.com/playwright image ships every browser and dependency, so nothing is missing at launch.

.github/workflows/ci.yml
container:
  image: mcr.microsoft.com/playwright:v1.49.0-jammy

How to prevent it

  • Always run playwright install --with-deps in CI, never plain install.
  • Pin the Playwright container image to the same version as the npm package.
  • Avoid alpine for Playwright; its musl libc is not supported by the browsers.

Frequently asked questions

What causes ""Host system is missing dependencies""?
A bare npx playwright install fetches the browser binaries but not the apt packages they need, so the dynamic linker fails at launch on a minimal image.
How do I fix "Host system is missing dependencies"?
Use the --with-deps flag so Playwright installs the apt packages alongside the browser binaries.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card