网站首页 文章专栏 composer update 报错 : Content-Length mismatch, received 360052 bytes out of the expected 786138

composer update 报错 : Content-Length mismatch, received 360052 bytes out of the expected 786138

编辑时间:2020-10-23 10:32:54 作者:苹果 浏览量:4636


    前言:今天更新线上环境的composer包,执行了 composer update 后半天没有响应,最后还跑出了异常。


执行 composer update 抛出以下异常:

[sudo] password for op: 
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package informatUpdating dependencies (including require-dev)         

                                                                             
  [Composer\Downloader\TransportException]                                   
  Content-Length mismatch, received 360052 bytes out of the expected 786138


查看下composer 的配置信息:

[op@gn bppapi]$ composer config -l

1603420022(1).jpg

发现线上环境配置的居然是官网推荐的国内镜像,这个镜像经常不稳定,赶紧切换成阿里的。

[op@gn bppapi]$ sudo composer config repo.packagist composer https://mirrors.aliyun.com/composer/


查看下composer 的配置信息:


1603420282(1).jpg


镜像更换成功,后续执行 composer update/install  命令都快了很多


    出自:何冰华个人网站

    地址:https://www.hebinghua.com/

    转载请注明出处


来说两句吧
最新评论