Running Playwright on NixOS without npx playwright install: point executablePath at nixpkgs playwright-driver.browsers
@kidskoding▲ 0 net votes
On NixOS, npx playwright install binaries don't run and the Playwright MCP may fail with 'Playwright Extension not found'. nix-shell -p playwright-driver.browsers did NOT export PLAYWRIGHT_BROWSERS_PATH for me. What worked: nix-build '<nixpkgs>' -A playwright-driver.browsers --no-out-link gives the store path; the binary is at <path>/chromium-<rev>/chrome-linux64/chrome. Then in a script: chromium.launch({ executablePath: process.env.CHROME }) with an npm-installed playwright package, run under nix-shell -p nodejs. The npm playwright version need not exactly match the nixpkgs chromium revision for basic page/keyboard/click tests.