Skip to content

fix: run the auto-install postinstall on Windows too - #39

Merged
plum117 merged 3 commits into
webdriverio:mainfrom
plum117:fix/postinstall-windows
Oct 9, 2026
Merged

plum117 merged 3 commits into
webdriverio:mainfrom
plum117:fix/postinstall-windows

Conversation

@plum117

@plum117 plum117 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Why

npm runs install scripts with cmd.exe on Windows, and cmd.exe has no test command. The postinstall script started with test -f ./dist/install.js, so on a typical Windows machine it always printed "Skipping install, project not built!", and EDGEDRIVER_AUTO_INSTALL / GECKODRIVER_AUTO_INSTALL did nothing.

The GitHub Windows runner has Git's Unix tools (test.exe) on PATH, so CI did not show it: the first test commit passed on Windows. With PATH limited to Node.js and System32, as on a user's machine, the test fails on Windows on the old script (run: runs dist/install.js when it is built, on every OS failed in both packages).

Change

  • postinstall: a node -e check replaces test -f. It works in sh and cmd.exe. As before, it prints "Skipping install, project not built!" when dist is missing (the workspace install), and a failed download still does not fail the install.
  • READMEs: pnpm 10+ and Bun run install scripts only for approved packages (pnpm approve-builds, trustedDependencies), and npm 11 warns until npm install-scripts approve <package>. If the download fails, the driver downloads on first use.
  • Upgrade note: on Windows, the auto-install flags now download the driver during the install.

Test plan

  • New tests/postinstall.test.ts in edgedriver and geckodriver: run the real script with npm's default shell and a minimal PATH. Red on Windows CI with the old script, green on macOS
  • EDGEDRIVER_AUTO_INSTALL=1 npm i <packed tarball> (npm 11.19): the driver downloads during the install
  • Windows CI green with the fix

🤖 Generated with Claude Code

plum117 and others added 3 commits October 9, 2026 16:02
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n PATH

The Windows runner has Git's Unix tools on PATH, so `test` worked there
and the test could not see what a user's Windows does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm runs scripts with cmd.exe on Windows, which has no `test`, so the
postinstall always printed "Skipping install" there and
EDGEDRIVER_AUTO_INSTALL / GECKODRIVER_AUTO_INSTALL did nothing. A node
check replaces `test -f`; a failed download still does not fail the
install. The READMEs now say that pnpm 10+, Bun and recent npm want
the package approved for install scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plum117
plum117 marked this pull request as ready for review October 9, 2026 20:15
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Makes edgedriver and geckodriver installation scripts work on Windows without Unix tools.

  • Edgedriver and geckodriver can install their drivers on Windows.

Reviews (1) · Last reviewed commit: "fix: run the auto-install postinstall on..." · Reviewed by Greptile

@plum117
plum117 merged commit 511f318 into webdriverio:main Oct 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant