MacOS下无法移除旧版ChromeDriver,无法切换至2.36版本求助
Hey there, let's work through this ChromeDriver version issue—this is super common when multiple binary versions end up scattered across your system, or your PATH is prioritizing the old binary over the new one. Here's how to track down and fix it:
Step 1: Find where your current ChromeDriver is located
First, let's pinpoint exactly which binary your terminal is calling when you run chromedriver -v. Run this command:
which chromedriver
This will output a path like /usr/local/bin/chromedriver or /usr/bin/chromedriver. This is the file we need to check/replace.
Step 2: Verify the version at that path
Double-check that the binary at the path above is indeed the old 2.35 version:
/path/from/which/chromedriver -v
(Replace /path/from/which/ with the output from the which command.) If this returns 2.35, that's the culprit—your system is still pointing to this old binary.
Step 3: Check your PATH priority
Your terminal uses the PATH environment variable to decide which binary to run first. Let's see the order of paths:
echo $PATH
Look for the path from Step 1 in this list. If there's another path where you installed ChromeDriver 2.36 that comes after this old path, the old binary will still be called first.
Step 4: Install/replace with ChromeDriver 2.36
Now let's get the correct version in place:
Option A: Using Homebrew (if available)
If the official Homebrew tap has version 2.36, you can install it with a version specifier:
brew install chromedriver@2.36
If that throws an error, move to Option B—manual installation is often more reliable for specific older versions.
Option B: Manual installation
- Download the ChromeDriver 2.36 binary matching your OS from the official ChromeDriver archive.
- Unzip the downloaded file to get the
chromedriverexecutable. - Replace the old binary with the new one (you'll likely need
sudofor permissions):sudo cp /path/to/unzipped/chromedriver /path/from/which/chromedriver - Make sure the new binary has execute permissions:
sudo chmod +x /path/from/which/chromedriver
Step 5: Refresh your terminal and verify
Close and reopen your terminal (to refresh the PATH cache), then run:
chromedriver -v
It should now show 2.36.
Why brew list chromedriver showed nothing?
That’s probably because your existing ChromeDriver wasn’t installed via Homebrew—you might have downloaded it manually before, so brew doesn’t track it. If you end up using brew to install 2.36, brew list chromedriver@2.36 should show it.
内容的提问来源于stack exchange,提问作者theJuls

