当本地运行composer update的时候提示Failed to update https://bitbucket.org/aaa/bbb.git package information from this repository may be outdated.
In VcsRepository.php line 419:
No valid composer.json was found in any branch or tag of https://bitbucket.org/aaa/bbb.git, could not load a package from it.
那么问题出在哪里呢?
通过composer update -vvv 定位到问题出现/Users/<user>/Library/Caches/composer/vcs/https---bitbucket.org-aaa-bbb.git/ 打开该目录下的config文件,里面的配置有异常。删除该目录,重新执行composer update,自此问题解决。
那么,这个目录是做什么的呢?
官方解释是:
cache-vcs-dir#
Defaults to $cache-dir/vcs
. Stores VCS clones for loading VCS repository metadata for the git
/hg
types and to speed up installs. [Config - Composer]
也是说它为安装的时候加速用的,每次就不必要从远程再拉,install的时候可以直接走cache。
composer update是怎么执行的呢?