From cc96c57e89ecc6ddc3fb6f1f57c196c6aa76a69c Mon Sep 17 00:00:00 2001 From: dprevost-perso-macos Date: Fri, 9 Oct 2026 16:17:28 -0400 Subject: [PATCH 1/2] docs: safaridriver has no CLI; copy the cached binary for selenium on Windows `npx safaridriver` fails with "could not determine executable to run": the package has no bin. The Windows note linked node_modules\geckodriver\geckodriver.exe, which does not exist: the binary is downloaded into the cache folder as geckodriver-.exe. Co-Authored-By: Claude Opus 5.5 --- README.md | 14 ++++++++------ packages/node-geckodriver/README.md | 8 +++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 81a7876..98358a3 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,10 @@ npx geckodriver --port=4444 # Start Edgedriver npx edgedriver --port=4444 -# Start Safaridriver (macOS) -npx safaridriver --port=4444 - ``` +The `safaridriver` package has no CLI: Safaridriver is part of macOS, so run `/usr/bin/safaridriver --port=4444` directly (once, run `safaridriver --enable` to allow remote automation). + ### Environment Variables & Global Installation Setup #### Auto-Installation Flags @@ -103,13 +102,16 @@ By default, binaries download when initialized via CLI or API. To download them #### Windows Setup (`selenium-webdriver` note) -When installing `geckodriver` or `edgedriver` globally on Windows, `selenium-webdriver` expects the `.exe` extension in PATH. You can create a symlink in your global npm binary directory: +A global install on Windows adds `geckodriver.cmd` and `edgedriver.cmd` to your `PATH`, but `selenium-webdriver` looks for `geckodriver.exe` and `msedgedriver.exe`. The packages download the binary into their cache folder, not into the package folder: `geckodriver-.exe` in `GECKODRIVER_CACHE_DIR`, `msedgedriver.exe` in `EDGEDRIVER_CACHE_DIR` (both default to the system temporary folder). Set the cache folder, run the driver once, then copy the binary to a folder on your `PATH`: ```cmd -mklink %USERPROFILE%\AppData\Roaming\npm\geckodriver.exe %USERPROFILE%\AppData\Roaming\npm\node_modules\geckodriver\geckodriver.exe - +set GECKODRIVER_CACHE_DIR=%USERPROFILE%\geckodriver +geckodriver --version +copy %GECKODRIVER_CACHE_DIR%\geckodriver-*.exe %APPDATA%\npm\geckodriver.exe ``` +Recent `selenium-webdriver` versions can also download the drivers themselves with Selenium Manager. + --- ## Programmatic Usage diff --git a/packages/node-geckodriver/README.md b/packages/node-geckodriver/README.md index cefcf94..4ff726f 100644 --- a/packages/node-geckodriver/README.md +++ b/packages/node-geckodriver/README.md @@ -19,10 +19,12 @@ Or install it globally: npm install -g geckodriver ``` -__Note:__ This installs a `geckodriver` shell script that runs the executable, but on Windows, [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) looks for `geckodriver.exe`. To use a global installation of this package with [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) on Windows, copy or link `geckodriver.exe` to a location on your `PATH` (such as the npm bin directory) after installing this package: +__Note:__ This installs a `geckodriver` shell script that runs the executable, but on Windows, [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) looks for `geckodriver.exe`. The package downloads the binary into its cache folder (`GECKODRIVER_CACHE_DIR`, by default the system temporary folder) as `geckodriver-.exe`, not into the package folder. Set the cache folder, run the driver once, then copy the binary to a folder on your `PATH` (such as the npm bin directory): -```sh -mklink %USERPROFILE%\AppData\Roaming\npm\geckodriver.exe %USERPROFILE%\AppData\Roaming\npm\node_modules\geckodriver\geckodriver.exe +```cmd +set GECKODRIVER_CACHE_DIR=%USERPROFILE%\geckodriver +geckodriver --version +copy %GECKODRIVER_CACHE_DIR%\geckodriver-*.exe %APPDATA%\npm\geckodriver.exe ``` Once installed you can start Geckodriver via: From af4468f60d51e6a6a28a6cb015d078b955e6c5ae Mon Sep 17 00:00:00 2001 From: dprevost-perso-macos Date: Fri, 9 Oct 2026 16:25:03 -0400 Subject: [PATCH 2/2] docs: copy one exact geckodriver version on Windows With a wildcard, Windows `copy` joins all matching files into one, so a cache with two versions gave a broken binary. Co-Authored-By: Claude Opus 5.5 --- README.md | 7 +++++-- packages/node-geckodriver/README.md | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 98358a3..d0569ff 100644 --- a/README.md +++ b/README.md @@ -102,14 +102,17 @@ By default, binaries download when initialized via CLI or API. To download them #### Windows Setup (`selenium-webdriver` note) -A global install on Windows adds `geckodriver.cmd` and `edgedriver.cmd` to your `PATH`, but `selenium-webdriver` looks for `geckodriver.exe` and `msedgedriver.exe`. The packages download the binary into their cache folder, not into the package folder: `geckodriver-.exe` in `GECKODRIVER_CACHE_DIR`, `msedgedriver.exe` in `EDGEDRIVER_CACHE_DIR` (both default to the system temporary folder). Set the cache folder, run the driver once, then copy the binary to a folder on your `PATH`: +A global install on Windows adds `geckodriver.cmd` and `edgedriver.cmd` to your `PATH`, but `selenium-webdriver` looks for `geckodriver.exe` and `msedgedriver.exe`. The packages download the binary into their cache folder, not into the package folder: `geckodriver-.exe` in `GECKODRIVER_CACHE_DIR`, `msedgedriver.exe` in `EDGEDRIVER_CACHE_DIR` (both default to the system temporary folder). Set the cache folder and the version, run the driver once, then copy the binary to a folder on your `PATH`: ```cmd set GECKODRIVER_CACHE_DIR=%USERPROFILE%\geckodriver +set GECKODRIVER_VERSION=0.37.1 geckodriver --version -copy %GECKODRIVER_CACHE_DIR%\geckodriver-*.exe %APPDATA%\npm\geckodriver.exe +copy /Y %GECKODRIVER_CACHE_DIR%\geckodriver-%GECKODRIVER_VERSION%.exe %APPDATA%\npm\geckodriver.exe ``` +Name the exact version: with a wildcard, `copy` joins all cached versions into one broken file. + Recent `selenium-webdriver` versions can also download the drivers themselves with Selenium Manager. --- diff --git a/packages/node-geckodriver/README.md b/packages/node-geckodriver/README.md index 4ff726f..b093cc4 100644 --- a/packages/node-geckodriver/README.md +++ b/packages/node-geckodriver/README.md @@ -19,14 +19,17 @@ Or install it globally: npm install -g geckodriver ``` -__Note:__ This installs a `geckodriver` shell script that runs the executable, but on Windows, [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) looks for `geckodriver.exe`. The package downloads the binary into its cache folder (`GECKODRIVER_CACHE_DIR`, by default the system temporary folder) as `geckodriver-.exe`, not into the package folder. Set the cache folder, run the driver once, then copy the binary to a folder on your `PATH` (such as the npm bin directory): +__Note:__ This installs a `geckodriver` shell script that runs the executable, but on Windows, [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) looks for `geckodriver.exe`. The package downloads the binary into its cache folder (`GECKODRIVER_CACHE_DIR`, by default the system temporary folder) as `geckodriver-.exe`, not into the package folder. Set the cache folder and the version, run the driver once, then copy the binary to a folder on your `PATH` (such as the npm bin directory): ```cmd set GECKODRIVER_CACHE_DIR=%USERPROFILE%\geckodriver +set GECKODRIVER_VERSION=0.37.1 geckodriver --version -copy %GECKODRIVER_CACHE_DIR%\geckodriver-*.exe %APPDATA%\npm\geckodriver.exe +copy /Y %GECKODRIVER_CACHE_DIR%\geckodriver-%GECKODRIVER_VERSION%.exe %APPDATA%\npm\geckodriver.exe ``` +Name the exact version: with a wildcard, `copy` joins all cached versions into one broken file. + Once installed you can start Geckodriver via: ```sh