- Symptom
- Executable doesn't exist at /home/node/.cache/ms-playwright/chromium-1208/chrome-linux/chromenpx playwright install ran as root in the build stage but the app runs as a non-root userA multi-stage build copies node_modules but not the browser cache
- Cause
- Browsers go to the current user's cache folder unless PLAYWRIGHT_BROWSERS_PATH is set, and the runtime looks in the same per-user default. A different user, HOME, or a missing env var at runtime points the lookup at an empty folder.
- Fix
- Set PLAYWRIGHT_BROWSERS_PATH to one shared folder for both the install step and the runtime, and copy that folder into the final stage. Use 0 to keep browsers inside node_modules instead. The variable does not move branded Chrome or Edge installs.
- Apply
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright RUN npx playwright install --with-deps chromium && chmod -R o+rx /ms-playwright # final stage COPY --from=build /ms-playwright /ms-playwright ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright- Affected
- All Playwright versions in Docker, CI caches and multi-user hosts
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders