由于 ECMDERR "Server aborted the SSL handshake",Bower 无法下载

Bower is unable to download due to ECMDERR "Server aborted the SSL handshake"

我在使用基本 Bower 命令(如安装或列表)时遇到问题 运行。当我 运行 Bower 所说的错误失败时,它 运行 没问题。 Bower 使用 git 配置的方式有什么不同吗?

▶ bower list
bower check-new     Checking for new versions of the project dependencies...
bower ECMDERR       Failed to execute "git ls-remote --tags --heads https://github.com/angular/bower-angular.git", exit code of #128 fatal: unable to access 'https://github.com/angular/bower-angular.git/': Server aborted the SSL handshake

Additional error details:
fatal: unable to access 'https://github.com/angular/bower-angular.git/': Server aborted the SSL handshake

▶ git ls-remote --tags --heads https://github.com/angular/bower-angular-animate.git | head
f52f83800624062443335a830112e3ae38b5c9cc    refs/heads/master
859e626c875659842d3582a0072fbb439b39f3a2    refs/tags/v1.2.0
4e6147d34c5e08bf9e7743bd36da35f19b265bf0    refs/tags/v1.2.0-rc.1
6ccd2d5b5b96506c98fe6158b7542dcf23a912a3    refs/tags/v1.2.0-rc.2
91aa0a12a19605b1166bf43d1444247a7320bd92    refs/tags/v1.2.0-rc.3
db9d2de12caaaa6603b06af504c6969a36431d0b    refs/tags/v1.2.1
0243df12570a70b5d07f83723e94e2a461982c99    refs/tags/v1.2.10
bd29251aa180d9cccff11dd583c928513662b101    refs/tags/v1.2.10-build.2136+sha.8ea8da4
fe72f28cc866777d0b07a6c44a66d75c2e3f22c9    refs/tags/v1.2.10-build.2139+sha.61eb426
b3b929d865c80e290935602587f2e0178b826262    refs/tags/v1.2.10-build.2140+sha.51a7f9d

该错误相当于bower install命令中的网络超时。通常发生在非常长的 bower.json 文件中。

你可以试试运行这个:

rm -rf bower_components
bower cache clean
bower install

此外,如果您再次点击 bower install,您可以看到以下内容之一:

  1. 它已经能够下载所有库并且不会再抛出该错误
  2. 它会抛出错误,但对于您 bower.json
  3. 中的不同条目

Bower 构建应该在多次重复执行相同的 bower install 命令后得到解决。无需一次又一次地发出 bower cache clean 命令。

打个比方,这就像在网络超时后尝试 ping 同一台服务器。解决方案不是很干净,但对我有用。

您可能想检查 github 上的 SSH 密钥。 先尝试删除它们。如果它不起作用,请使用新生成的密钥进行更新。

我遇到了这个问题 git fetchgit ls-remote --tags --heads https://... 这解决了我的问题。