The following tutorial column of composer will introduce to you the solution to the slow installation dependency of composer, and check the detailed execution log of composer. I hope it will be helpful to friends in need!
composer installation dependencies are slow, check composer’s detailed execution log
Installing composer dependencies on windows WSL
composer install
It was found that the execution was abnormally slow. It was suspected that the domestic mirror was not used, but github was directly accessed.
Need to see composer’s execution log
composer -h
I found that composer’s parameters support
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
So
composer -vvv install
As expected, they all went to github. . .
Installing backpack/crud (3.2.27): Downloading https://api.github.com/repos/Laravel-Backpack/CRUD/zipball/54fb667a1cf64f4c53f8a90a3752d1f964fdec6f Downloading (connecting...) Following redirect (2) https://codeload.github.com/Laravel-Backpack/CRUD/legacy.zip/54fb667a1cf64f4c53f8a90a3752d1f964fdec6f
After I updated to the domestic mirror source of https://laravel-china.org/composer, I found that the installation was still done through github.
After checking, it turned out to be a problem with composer.lock. Delete composer.lock and run composer install to regenerate it. The reason is that composer.lock caches the previous configuration information, causing the new image configuration to be invalid.
For more composer technical articles, please visit the composer column. The address is: https://www.php.cn/tool/composer/
The above is the detailed content of What should I do if composer installation dependencies are slow?. For more information, please follow other related articles on the PHP Chinese website!