【发布时间】:2020-06-26 05:36:44
【问题描述】:
几天以来,我无法在本地 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 密钥是问题,但我创建了一个新密钥并将其添加到 github 并出现相同的错误。
比我用composer clear 试一试,但问题没有解决。
问题出现在 EACH docker 容器和 EACH 作曲家包中......所以我不能成为单个包或容器的问题。
有没有人知道我可以再次使用作曲家?
【问题讨论】:
-
输出告诉你发生了什么:
fc10d778e4b84d5bd315dad194661e091d307c6f is gone (history was rewritten?)。在 packagist 中有对该提交的引用,但如果你到 Github 上该提交不在 master 中,这意味着历史被重写。您可以尝试安装 zip 扩展,这将使 composer 从 packagegist 获取。 -
@snahor 提交已经存在。我无法使用此提交签出存储库,并且工作正常。只有作曲家不会获取它,它在 EACH 包上(带有其他提交但相同的错误消息)。
标签: php git docker composer-php