获取 ChromeDriver 安装失败“未找到中央目录记录签名的结尾”

JGl*_*son 5 selenium-chromedriver

当我尝试运行 npm install chromedriver 我得到...

ChromeDriver installation failed Error extracting archive: Error: end of central directory record signature not found
Run Code Online (Sandbox Code Playgroud)

好像和这个差不多。

dre*_*801 0

当我尝试将以下内容添加到我的 .npmrc 文件时,我收到了同样的问题:

chromedriver_cdnurl=https://myMirror.blah
Run Code Online (Sandbox Code Playgroud)

使用 npm install 的详细版本,我能够找到它尝试下载的 zip 文件。

npm install -ddd
Run Code Online (Sandbox Code Playgroud)

我尝试手动解压缩该文件并发现它是空的

less zipFileName.zip
unzip zipFileName.zip
Run Code Online (Sandbox Code Playgroud)

所以我意识到我实际上传递了错误的 URL,并且我还需要传递凭据才能下载。

https://<USERNAME>:<PASSWORD>@MyMirror.blah
Run Code Online (Sandbox Code Playgroud)

不确定您的环境,但我需要针对我的环境指向 Artifactory 而不是 chromedriver 镜像。