当我运行composer update时出现此错误:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Updating knplabs/knp-paginator-bundle (dev-master 5386aa8 => 2.4.0)
[RuntimeException]
Failed to execute git status --porcelain --untracked-files=no
fatal: bad object HEAD
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
我不知道如何解决它。我可以通过其他方式更新KnpPaginatorBundle吗?
我该怎么做才能解决它?
答案 0 :(得分:1)
如果供应商目录中的内容中断,您可以随时将其完全删除,然后让Composer再次创建它。
您似乎正在更新到新发布的版本,因此如果Composer仍然抱怨该存储库被破坏,请尝试下载该软件的ZIP:
composer update --prefer-dist
答案 1 :(得分:1)
我删除了整个供应商目录并执行了:
composer install
并且它第五次起作用。是的,这是神奇的东西......