Composer Content-Length Mismatch

前端 未结 11 1567
暗喜
暗喜 2020-11-28 06:03

Sometimes when I run composer update to upgrade the laravel project, a content-length mismatch exception might occur. Finally, I get this is because of the terrible firewall

11条回答
  •  执念已碎
    2020-11-28 06:45

    Just change the composer default repo url:

    composer config -g repo.packagist composer https://packagist.org
    composer config -g github-protocols https ssh
    

    It changes or sets the packagist repo to be used by https only.

    This fixes any issues with local composer.json files too. No need to mess around with the composer.json file localy or global.

提交回复
热议问题