为什么作曲家会说“结论:不要安装”?什么时候(貌似)没有障碍物? [英] Why composer says "Conclusion: don't install" when (seemingly) no obstacles are present?

查看:64
本文介绍了为什么作曲家会说“结论:不要安装”?什么时候(貌似)没有障碍物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下 composer.json

{
    "type": "project",
    "minimum-stability": "dev",
    "require": {
        "jasny/bootstrap": ">=3.1.3",
        "2amigos/yii2-file-input-widget": "*"
    }
}

导致组成更新的以下输出:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.                               

  Problem 1
    - 2amigos/yii2-file-input-widget 0.1.2 requires jasny/bootstrap v3.1.0 -> satisfiable by jasny/bootstrap[v3.1.0] but these conflict with your requirements or minimum-stability.
    - 2amigos/yii2-file-input-widget 0.1.1 requires jasny/bootstrap v3.1.0 -> satisfiable by jasny/bootstrap[v3.1.0] but these conflict with your requirements or minimum-stability.
    - 2amigos/yii2-file-input-widget 0.1.0 requires jasny/bootstrap v3.1.0 -> satisfiable by jasny/bootstrap[v3.1.0] but these conflict with your requirements or minimum-stability.
    - 2amigos/yii2-file-input-widget 1.0.0 requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3].
    - 2amigos/yii2-file-input-widget 1.0.1 requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3].
    - 2amigos/yii2-file-input-widget 1.0.2 requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3].
    - 2amigos/yii2-file-input-widget dev-master requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3].
    - 2amigos/yii2-file-input-widget 1.0.x-dev requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3].
    - Conclusion: don't install jasny/bootstrap v3.1.3
    - Installation request for 2amigos/yii2-file-input-widget * -> satisfiable by 2amigos/yii2-file-input-widget[0.1.0, 0.1.1, 0.1.2, 1.0.0, 1.0.1, 1.0.2, dev-master, 1.0.x-dev].

为什么?

好,我知道,为什么版本 0.1.0–0.1.2 2 amigos/yii2-file-input-widget 无法安装-因为它们需要 jasny / bootstrap 的确切版本 3.1.0 ,它与 composer.json 中的> = 3.1.3 要求冲突(因此,作曲家阐明:,但是这些与您的要求或最低稳定性冲突。

Ok, I understand, why versions 0.1.0–0.1.2 of 2amigos/yii2-file-input-widget can't be installed — because they require jasny/bootstrap of exact version 3.1.0, which conflicts with >=3.1.3 requirement in composer.json (and therefore composer clarifies: but these conflict with your requirements or minimum-stability).

但是,从常识上来说,作曲家可以安装版本1.0.0或更高版本的 2 amigos/yii2-file-input-widget (需要 jasny / bootstrap 版本的〜3.1.0 ,这可由3.1.3满足)。我没有看到安装 2 amigos/yii2-file-input-widget 1.0.0+和 jasny / bootstrap 3.1.3,作曲家也没有对此做任何明确的说明。仍然说:结论:不要安装jasny / bootstrap v3.1.3 —为什么?

But, from common-sense view, composer can install version 1.0.0 or later of 2amigos/yii2-file-input-widget (which requires jasny/bootstrap of version ~3.1.0, which is satisfiable by 3.1.3). Neither I see any obstacles for installing 2amigos/yii2-file-input-widget 1.0.0+ together with jasny/bootstrap 3.1.3, nor composer writes any explicit clarification about it. Still it says: Conclusion: don't install jasny/bootstrap v3.1.3 — why?

似乎可以与 prefer-stable:true 一起使用。

前一段时间我实际上找到了另一种解决方法:我替换了 2 amigos/yii2-file-input-widget : * 2 amigos/yii2-file-input-widget: 1.0.2 ,执行 composer update ,然后将其放回原位,然后再次执行 composer update -它将起作用。

I actually found the other workaround some time ago: I replace "2amigos/yii2-file-input-widget": "*" with "2amigos/yii2-file-input-widget": "1.0.2", do composer update and then replace it back and do composer update again — and it works.

问题是为什么它如此奇怪地起作用:为什么它受更多限制,而失败却受更少限制(没有澄清)。例如。如果它与 1.0.2 (或首选稳定)一起使用,那么为什么它不与 * 一起使用(或没有偏好稳定)?

The question is why it works in so strange way: why it works with more restrictions, but fails with less restrictions (with no clarification). E.g. if it works with 1.0.2 (or with prefer-stable) works — then why it doesn't with * (or without prefer-stable)?

推荐答案

更改顺序,它应该可以工作,例如

Change the order and it should work, e.g.

{
    "minimum-stability": "dev",
    "require": {
        "2amigos/yii2-file-input-widget": "*",
        "jasny/bootstrap": ">=3.1.3"
    }
}

为什么?我不知道。

我已经使用 composer install 在空文件夹上测试了两种配置,并且顺序不同。命令(Composer v1.6.3),原始顺序失败,但是上述顺序有效。我已经在 GH-7215 中报告了该问题。

I've tested two configurations with different order on the empty folder using composer install command (Composer v1.6.3), the original order fails, however the order above works. I've reported the issue at GH-7215.

这篇关于为什么作曲家会说“结论:不要安装”?什么时候(貌似)没有障碍物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆