Composer update遇到 Content-Length mismatch, received 137675 bytes out of the expected 2367236

今日composer update,遇到如下报错
Composer update遇到 Content-Length mismatch, received 137675 bytes out of the expected 2367236

解决方案

  1. 查看当前镜像源 composer config -l
    Composer update遇到 Content-Length mismatch, received 137675 bytes out of the expected 2367236
  2. 上图可以看到使用的是国外镜像,此处要使用中国镜像源
    composer config repo.packagist composer https://mirrors.aliyun.com/composer/
    Composer update遇到 Content-Length mismatch, received 137675 bytes out of the expected 2367236
  3. 再次确认镜像源情况
    Composer update遇到 Content-Length mismatch, received 137675 bytes out of the expected 2367236
  4. 此处黄色警告,提示我composer版本太久,我先更新下composer(若无该提醒此步骤不需要执行) composer self-update -vvv
  5. 此时再次update用的是阿里云的镜像云,也无报错信息了
    Composer update遇到 Content-Length mismatch, received 137675 bytes out of the expected 2367236