最近将composer升级到2.0,下载包的时候就报错了。
去 packagist 网站能搜到这个包 https://packagist.org/?query=captcha
那应该是源的问题吧,因为各种镜像源加速都是拷贝的官方的数据到国内。
查看当前使用的哪个源
$ composer config --list repos.packagist[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://packagist.phpcomposer.com
[process-timeout] 300
[use-include-path] false
...
看来我设置的是 https://packagist.phpcomposer.com
取消代理源 composer config -g --unset repos.packagist
确认一下
$ composer config --list repos.packagist
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https?://repo.packagist.org
[repositories.packagist.org.allow_ssl_downgrade] true
[process-timeout] 300
[use-include-path] false
变成了官方源了 repo.packagist.org
再次执行下载
可以下载了,其实我觉得官网并不算慢。