尝试从 toran 获取所需的私有库时的 Composer 警告

Posted

技术标签:

【中文标题】尝试从 toran 获取所需的私有库时的 Composer 警告【英文标题】:Composer warning when trying to get a required private library from toran 【发布时间】:2017-08-07 10:14:21 【问题描述】:

当我的作曲家尝试从 toran 获取私有库时,我收到以下警告:

来自https://toran.dev.lan/repo/packagist的警告:原文 无法获取提供者

运行composer require app/client:^6.0 给出:

user@u:~/Projects/app$ composer require app/client:^6.0
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Warning from https://toran.dev.lan/repo/packagist: The original providers could not be fetched
Warning from https://toran.dev.lan/repo/packagist: The original providers could not be fetched

正在运行composer require app/client:^6.0 -vvv 给出:

Downloading https://toran.dev.lan/repo/packagist/p/app/accounting-common.json
Warning from https://toran.dev.lan/repo/packagist: The original
providers could not be fetched

Writing /home/user/.composer/cache/repo/https---toran.dev.lan-repo-packagist/provider-app$accounting-common.json into cache

Downloading https://toran.dev.lan/repo/packagist/p/app/php-amqplib-extension.json
Warning from https://toran.dev.lan/repo/packagist: The original providers could not be fetched
Writing /home/user/.composer/cache/repo/https---toran.dev.lan-repo-packagist/provider-app$php-amqplib-extension.json into cache

Downloading https://toran.dev.lan/repo/packagist/p/app/lib-symfony-components.json
Warning from https://toran.dev.lan/repo/packagist: The original providers could not be fetched
Writing /home/user/.composer/cache/repo/https---toran.dev.lan-repo-packagist/provider-app$lib-symfony-components.json into cache

Downloading https://toran.dev.lan/repo/packagist/p/app/lib-dependency-injection.json
Warning from https://toran.dev.lan/repo/packagist: The original providers could not be fetched
Writing /home/user/.composer/cache/repo/https---toran.dev.lan-repo-packagist/provider-app$lib-dependency-injection.json into cache

Downloading https://toran.dev.lan/repo/packagist/p/app/rabbitmq-extension-bundle.json
Warning from https://toran.dev.lan/repo/packagist: The original providers could not be fetched
Writing /home/user/.composer/cache/repo/https---toran.dev.lan-repo-packagist/provider-app$rabbitmq-extension-bundle.json into cache

为什么我会收到此警告?

【问题讨论】:

我也遇到了这个问题,正在调查它。据我所知,它似乎与公共代理有关,可能是因为有一个不由任何公共代理托管的包。我会及时通知您我的发现,如果我找到解决方案,请提交答案:) 【参考方案1】:

似乎是php版本的问题,项目是5.6,我本地的php版本是7.0。我还必须从使用 docker 的 Project 容器中启动 composer require 才能正常工作。

【讨论】:

【参考方案2】:

这也是 Composer 1.4+ 与 Toran 中的私有包结合的一个已知问题。 Composer 错误地获取公共 Toran 存储库而不是私有存储库。有关当前进度的更多信息,请参阅此 Github 问题:https://github.com/composer/composer/issues/6383

目前没有修复。

【讨论】:

【参考方案3】:

我也遇到过这个问题,现在没有了。

我一直在使用 Toran 来提供我们的私有包和公共包(所有这些都可以通过 packagist 获得)。通过删除我们 composer.json 文件中的公共存储库行,一切都加载正常,我不再收到错误。

明确一点 - 我们已经删除了 public repos 行和 "packagist":"false" 行。

【讨论】:

以上是关于尝试从 toran 获取所需的私有库时的 Composer 警告的主要内容,如果未能解决你的问题,请参考以下文章

尝试从 Access 运行 Excel 以格式化导出的表,获取所需的对象错误

从 Spotify End Point 获取所需的图像

如何获取 hideSoftInputFromInputMethod(token, flags) 所需的令牌?

尝试访问受保护页面时尝试获取登录所需的工作

使用 pip 安装私有 github 存储库时遇到问题

输入一个子节点以获取进入另一个子节点所需的信息