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.
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-depsCommon 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.
npx playwright install --with-depsUse the official Playwright container image
The mcr.microsoft.com/playwright image ships every browser and dependency, so nothing is missing at launch.
container:
image: mcr.microsoft.com/playwright:v1.49.0-jammyHow to prevent it
- Always run
playwright install --with-depsin CI, never plaininstall. - 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.