bower install 443报错

bower ECMDERR       Failed to execute "git ls-remote --tags --heads https://github.com/hhurz/tableExport.jquery.plugin.git", exit code of #128 fatal: unable to access 'https://github.com/hhurz/tableExport.jquery.plugin.git/': Failed to connect to github.com port 443: Operation timed out

fatal: unable to access 'https://github.com/hhurz/tableExport.jquery.plugin.git/': Failed to connect to github.com port 443: Operation timed out

使用bower install 安装包的时候总是报错,已经添加github的ip至host 和 使用vpn都没有办法结局

阅读 5k
3 个回答

上诉报错就是因为连接不上 github 所导致的。

  • 添加 github 的 ip 至 host

不清楚 host 修改是否正确,可以使用 curl https://github.com 测试是否成功。

如果还是未成功,可以使用 https://github.com/baiyutang/github-ips 中的替换。

我未修改过 host,故不保证 https://github.com/baiyutang/github-ips 中的 ip 一定能行。
  • 使用 vpn

如果是在 terminal 中,还需要设置 proxy。

对于 Linux&MacOS 来说:

$ export http_proxy=http://<ip>:<port>
$ export https_proxy=http://<ip>:<port>
将上诉 ip 和 port 替换成对应即可。

最后测试 proxy 是否成功:

$ curl https://github.com -v
-v: 查看详细信息

马上 2022 年了,别用 bower 了……随便切到 webpack、rollup 都可以。

使用下面的命令傻瓜式安装:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
已全部替换为国内源,X86 和 ARM 都可以用

参考文章:国内安装 brew 卡住不动的解决办法

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题