作曲家不满意的要求 [英] Composer unsatisfied requirement

查看:102
本文介绍了作曲家不满意的要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在作曲家设置中,我需要vendor/package-Avendor/package-B.

In a composer setup I need vendor/package-A and vendor/package-B.

程序包B建立在程序包A上,并在composer.json中将A定义为要求.

Package B builds upon package A and has A defined as a requirement in its composer.json.

直接安装基本软件包A可以正常工作. Packagist可以解决其他要求,并且可以从私有存储库中正确提取软件包本身.

Directly installing the base package A works fine. Other requirements are resolved from Packagist and the package itself is correctly pulled from the private repository.

但是,当仅安装软件包B时(由于需要,软件包B也应引入软件包A),我会收到以下错误消息:

However, when installing only package B (which should then also pull in package A due to the requirement), I get the following error:

Your requirements could not be resolved to an installable set of packages.

Problem 1
  - Installation request for vendor/package-B dev-master@dev -> satisfiable by vendor/package-B[dev-master].
  - vendor/package-B dev-master requires vendor/package-A dev-master@dev -> no matching package found.

这两个软件包都没有任何带标签的发行版,并且可以在dev-master版本上运行.

Both packages don't have any tagged releases and operate at the dev-master version.

我有什么要注意的吗?

编辑

对于那些对解决方案感兴趣的人,这是我从下面的选定答案中学到的总结.

For those interested in the solution, this is a summary from what I've learned from the selected answer below.

基本上,存在三种方法来获取深入的dev-master依赖项.按照最推荐的顺序:

Basically, three methods exist to get deep dev-master dependencies installed. In order of most recommended:

  1. 标记所有发行版,并使用标记的版本约束,而不是在各处使用dev-master. (我实际上最终做到了!)

在应用程序的composer.json中,使用@dev标志为开发中所需的子依赖项添加一个附加的require键.

In your application's composer.json, add an additional require key using the @dev flag for the corresponding subdepencency you need in dev:

{
    "require": {
        "vendor/package-B": "dev-master",
        "vendor/package-A": "@dev"
    }
}

这样,您就可以将要用作开发人员的特定从属基本列入白名单.

This way you basically whitelist a specific subdependency to be used as dev.

在应用程序的composer.json中,如下添加minimum-stabilityprefer-stable键.

In your application's composer.json, add the minimum-stability and prefer-stable keys as follows.

{
    "minimum-stability": "dev",
    "prefer-stable" : true
}

在最后一种方法中,您降低了要开发的稳定性约束,但是您还设置了如果有稳定版本可用,则您宁愿选择一个稳定版本.在大多数情况下,这会产生想要的行为,但有时可能会很古怪.

In this last method you lower the stability constraint to be dev, but you also set that IF a stable version is available, you'll prefer that one instead. Most of the time this would generate the wanted behavior, but sometimes it can be quirky.

推荐答案

这是稳定性解决问题.

针对这种情况的最佳解决方案是开始标记发布版本.

The best solution for this situation is to start tagging your releases.

您可以定义"minmum-stability":"dev".

它将设置下限,并允许所有软件包使用"dev"软件包.

It will set the lower bound and allow "dev" packages for all packages.

您已明确定义dev-master@dev. 我不确定这是否确实需要.

You have explicitly defined dev-master@dev. I'm not sure that this is really needed.

这说明了您的情况: https://igor.io/2013/02/07/composer-stability-flags.html

这篇关于作曲家不满意的要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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