方法一 添加国内加速源

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

方法二设置超时时间

composer config --global process-timeout 900

方法三安装时设置超时时间

COMPOSER_PROCESS_TIMEOUT=900  composer install