When multiple users share the same playwright-cli installation, the socket file path defaults to the same /tmp/playwright-cli/[hash]/. This would cause a EACCES: permission denied error for the second user onwards.
This happens because
- when
PLAYWRIGHT_DAEMON_SOCKETS_DIR is not set, program.js defaults to creating a directory called playwright-cli in the default temporary directory;
- when
.playwright is not present in the workspace, registry.js defaults to using the global installation path of the module to generate the hash.
As far as I can tell, PLAYWRIGHT_DAEMON_SOCKETS_DIR is not documented anywhere, and .playwright is not created by default. This makes the error very likely to appear in a centrally-managed, shared environment.
It seems that a simple solution would be to use a different path per user, but I am wondering if the current implementation is intentional or not.
When multiple users share the same playwright-cli installation, the socket file path defaults to the same
/tmp/playwright-cli/[hash]/. This would cause aEACCES: permission deniederror for the second user onwards.This happens because
PLAYWRIGHT_DAEMON_SOCKETS_DIRis not set,program.jsdefaults to creating a directory calledplaywright-cliin the default temporary directory;.playwrightis not present in the workspace,registry.jsdefaults to using the global installation path of the module to generate the hash.As far as I can tell,
PLAYWRIGHT_DAEMON_SOCKETS_DIRis not documented anywhere, and.playwrightis not created by default. This makes the error very likely to appear in a centrally-managed, shared environment.It seems that a simple solution would be to use a different path per user, but I am wondering if the current implementation is intentional or not.