我想在brew中安装chromedriver版本79.0.3945.36
。当我尝试运行
brew cask install chromedriver@79.0.3945.36
无法说出chromedriver@79.0.3945.36 is unavailable: No Cask with this name exists.
答案 0 :(得分:1)
我做了一个快速检查,没有发现木桶公式有版本号。
安装旧版本的cask公式的黑客方式为:
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
,转到引用酒桶的地方git reset --hard c3c1b84b7a
,这将有效地将chromedriver设置为v79.0.3945.36
git checkout -b temp
,签出新分支,以防止brew自动刷新您的本地主服务器。brew cask install chromedriver
,这将安装您想要的版本。之后,您始终可以执行git checkout master
和brew up
与最新的homebrew-cask
母版保持同步。
这是我的安装日志
==> Downloading https://chromedriver.storage.googleapis.com/79.0.3945.36/chromedriver_mac64.zip
Already downloaded: /Users/rchen/Library/Caches/Homebrew/downloads/2712e559b7e0712e196b123a7581adecc2cfdc8d8d728b01fd875b3d371e5d29--chromedriver_mac64.zip
==> Verifying SHA-256 checksum for Cask 'chromedriver'.
==> Installing Cask chromedriver
==> Linking Binary 'chromedriver' to '/usr/local/bin/chromedriver'.
? chromedriver was successfully installed!
测试日志:
$ chromedriver --version
ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614})
答案 1 :(得分:1)
以@chenrui 的回答为基础,这就是我在 M1 mac 上的做法(从 93 降级到 92)。这也适用于英特尔(通过 brew --prefix
)。
# Get commit which upgraded
cd "$(brew --prefix)/Library/Taps/homebrew/homebrew-cask/Casks"
git log chromedriver.rb
# Revert commit(s) which upgraded, eg ed35867f216512c9840756dce57e61f8eac26bb6
git revert ed35867f216512c9840756dce57e61f8eac26bb6
# Reinstall
brew reinstall chromedriver
# Pin version
brew pin chromedriver
# Resolve error: "chromedriver" cannot be opened because the developer cannot be verified.
xattr -d com.apple.quarantine "$(which chromedriver)"
# Later, when version no longer needs to be pinned
brew unpin chromedriver
答案 2 :(得分:1)
我在下面尝试过,它奏效了!
(请参阅 - https://sites.google.com/chromium.org/driver/downloads 以了解所需的版本号)
brew reinstall chromedriver
(注意:您可能需要删除下载的 chromedriver.zip 文件,请按照终端错误消息中提到的说明/路径位置删除该文件,然后继续下一步)
brew reinstall chromedriver