#1121984 python3-playwright: 'python3 -mplaywright install' fails to find Node Playwright

#1121984#5
Date:
2025-12-05 14:01:26 UTC
From:
To:
Dear Maintainer,

The new python3-playwright package does not work as expected. Running the
documented command to install browser binaries fails with a Node.js error:

  node:internal/modules/cjs/loader:1386
    throw err;
    ^

  Error: Cannot find module '/usr/share/nodejs/playwright/cli.js'
      at Module._resolveFilename (node:internal/modules/cjs/loader:1383:15)
      at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
      at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
      at Module._load (node:internal/modules/cjs/loader:1192:37)
      at TracingChannel.traceSync (node:diagnostics_channel:328:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
      at node:internal/main/run_main_module:36:49 {
    code: 'MODULE_NOT_FOUND',
    requireStack: []
  }

  Node.js v22.21.1

The path in the stack trace (/usr/share/nodejs/playwright/cli.js) does
not exist. Python Playwright is invoking the Node version of Playwright,
but the Debian package does not ship the corresponding Node module. As a
result, the primary command for fetching Playwright browsers cannot be
used.

Thanks for your work maintaining Playwright in Debian.

#1121984#10
Date:
2026-03-07 19:20:30 UTC
From:
To:
The primary issue here is that there's simply no dependency on
node-playwright in this package (also filed as
https://bugs.launchpad.net/ubuntu/+source/python-playwright/+bug/2143633
before realizing it was actually a problem in Debian too.)

It's *also* a problem (1129581) that Debian's node-playwright is too
old, so it might be accurate to have the dependency be versioned -
https://github.com/microsoft/playwright-python/issues/2130 suggests that
the main problem is on the 1.38→1.39 upgrade boundary, but there are
probably others, and that ticket suggests keeping them in sync.