[Composer\Downloader\TransportException] Content-Length mismatch

Error details:

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

Situation where the error occurred:

  When using the composer update command.

 

Solution:

  (1) To replace the composer image source, you can try the following:

    Change to Ali mirror: composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

    Replace with Laravel China mirror: composer config -g repo.packagist composer https://packagist.laravel-china.org

    Replace with the full Chinese mirror: composer config -g repo.packagist composer https://packagist.phpcomposer.com

  (2) If the image is replaced and the download is not successful, there may be a network problem:

      1. (Virtual machine environment) You can try to change the static IP to dynamic acquisition, and the bridge to network address translation.

      2. Download and upload via ftp or file sharing.

Published 210 original articles · praised 37 · 170,000 views +

Guess you like

Origin blog.csdn.net/u012757419/article/details/105429069