几天以来,我再也无法在本地docker容器中安装composer-packages了。
我使用composer init
创建了一个新的composer.json,并尝试使用composer require fzaninotto/faker
添加一个包
我总是收到相同的错误消息
# composer require fzaninotto/faker
Using version ^1.9 for fzaninotto/faker
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Failed to download fzaninotto/faker from dist: The zip extension and unzip command are both missing, skipping.
Your command-line PHP is using multiple ini files. Run `php --ini` to show them.
Now trying to download from source
- Installing fzaninotto/faker (v1.9.1): Cloning fc10d778e4 from cache
fc10d778e4b84d5bd315dad194661e091d307c6f is gone (history was rewritten?)
Installation failed, reverting ./composer.json to its original content.
[RuntimeException]
Failed to execute git checkout 'fc10d778e4b84d5bd315dad194661e091d307c6f' -- && git reset --hard 'fc10d778e4b84d5bd315dad194661e091d307c6f' --
fatal: failed to read object fc10d778e4b84d5bd315dad194661e091d307c6f: Operation not permitted
require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
首先,我想我的ssh密钥是问题,但是我创建了一个新的ssh密钥,并将其添加到github并出现相同的错误。
比起我用composer clear
来尝试,问题没有解决。
问题出现在 EACH Docker容器和 EACH 作曲家软件包中……因此,对于单个软件包或容器,我不能成为问题。
有没有人知道我可以再次使用作曲家?
答案 0 :(得分:4)
如果您使用的是 Docker Desktop(Windows),并且已更新到最新版本2.2.0.4,则会出现此问题。
降级到2.2.0.3,它应该可以再次工作(至少对我而言是如此)。 参见:https://forums.docker.com/t/issues-after-upgrading-docker-desktop-to-2-2-0-4/90589
要降级:
答案 1 :(得分:0)
对于最高答案,我没有足够的要点发表意见,但Docker问题刚刚结束(like an hour ago!),因此只需在Windows上更新Docker Desktop即可解决。至少为我工作。现在,我可以再次安装Drupal了!