Skip to content

postinstall npx playwright install chromium can resolve a global playwright — wrong browser revision + pre-1.60 extraction hang #5

Description

@raviwu

Environment: verdict-cli 0.1.1 · macOS arm64 · Node 26.3.0 / npm 11.16 · global @playwright/test 1.59.1 on PATH

What happened

npm install -g verdict-cli hung indefinitely at the postinstall (Chromium download reached 100%, then froze overnight). After recovering manually, verdict failed to start:

browserType.launch: Executable doesn't exist at …/chromium_headless_shell-1223/chrome-headless-shell-mac-arm64/chrome-headless-shell

Root cause

The postinstall runs npx playwright install chromium. npx can resolve playwright from PATH — here a globally installed @playwright/test 1.59.1 — instead of the playwright 1.60 bundled in verdict-cli's own node_modules. Two failure modes follow:

  1. Wrong revision: the global 1.59.1 installs chromium v1217, but the server (bundled playwright 1.60) needs v1223 → "Executable doesn't exist" even after a "successful" install.
  2. Extraction hang: playwright < 1.60 hangs forever at zip extraction on Node 24.16+/26 ([Bug]: playwright install hangs in node v26 microsoft/playwright#40724), so the postinstall itself never finishes — and npm buffers postinstall output, so it looks like a generic freeze.

Suggested fix

Change the postinstall script from npx playwright install chromium to playwright install chromium. npm puts the package's own node_modules/.bin first on PATH during lifecycle scripts, so the bundled playwright CLI (and its matching browser revision) always wins, regardless of what's installed globally.

Workaround for affected users

cd "$(npm root -g)/verdict-cli" && node_modules/.bin/playwright install chromium

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions