本文介绍了如何解决作曲家的“足够稳定的版本中不可用的包"错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我一直在对 Composer 最低稳定性进行大量研究.我进入官方文档并阅读了有关最低稳定性更改的信息.但是,即便如此,我也无法让作曲家安装依赖项.

我有根包和另外两个,我们称它们为 packageA 和 packageB.当我需要根包中的packageB时,packageB必须随身携带packageA,但这就是我收到错误的时候.

您的需求无法解决为一组可安装的软件包.

问题 1

  • packageB/packageB dev-master 的安装请求 -> packageA/packageA[dev-master] 可满足.
  • packageB/packageB dev-master 需要 packageA/packageA dev-master -> 找不到匹配的包.

潜在原因:

  • 包名中的类型
  • 根据您的最低稳定性设置,该软件包没有足够稳定的版本.

我的composer.json的根包短版

{要求": {packageB/packageB":开发大师"},存储库":[{类型":vcs","url": "[email protected]:packageB/packageB.git"}],最低稳定性":开发"}

包我的 composer.json 的简短版本

{要求": {},最低稳定性":开发"}

我的 composer.json 的 packageB 短版

{要求": {packageA/packageA":开发大师"},存储库":[{类型":vcs","url": "[email protected]:packageA/packageA.git"}],最低稳定性":开发"}

root需要packageB,需要packageA,但是packageB说在匹配条件下找不到packageA.

我做错了什么?

非常感谢.

解决方案

我找到了合适的解决方案.

这就是我所做的.

第一:

我删除了包 A 和 B 的 composer.json 中的最低稳定性字段;因为最低稳定性是一个仅限根的字段.如本 [链接] https://getcomposer.org/doc/04 中所述-schema.md#minimum-stability).

但真正的解决方案是,当我使用自己的私有包时,我使用 bitbucket 来托管这两个包,将 repos 指向根 composer.json 内的repositories"字段中的根 composer 和packageB 作曲家.

这就是问题所在.

如本链接中所述,作曲家的根包必须在存储库字段中包含所有存储库的链接.

就是这样:

我的composer.json的根包短版

{要求": {packageB/packageB":开发大师"},存储库":[{类型":vcs","url": "[email protected]:packageB/packageB.git"},{类型":vcs","url": "[email protected]:packageA/packageA.git"}],最低稳定性":开发"}

包我的 composer.json 的简短版本

{要求": {}}

我的 composer.json 的 packageB 短版

{要求": {packageA/packageA":开发大师"}}

希望它有效,因为它对我有用.和平吧!

Recently, I've been doing a lot of research about Composer minimum-stability. I get into the official documentation and read about the minimum-stability change. But, even so I cant get the composer to install the dependencies.

I have the root package and two others, let's call them packageA and packageB.When I required the packageB in the root package, the packageB has to bring with him the packageA, but that's when i'm getting the error.

The root package short version of my composer.json


    {
      "require": {
        "packageB/packageB": "dev-master"
      },
      "repositories": [
        {
          "type": "vcs",
          "url":  "[email protected]:packageB/packageB.git"
        }
      ],
      "minimum-stability": "dev"
    }

The packageA short version of my composer.json


    {
      "require": {

      },
      "minimum-stability": "dev"
    }

The packageB short version of my composer.json


    {
      "require": {
        "packageA/packageA": "dev-master"
      },
      "repositories": [
        {
          "type": "vcs",
          "url":  "[email protected]:packageA/packageA.git"
        }
      ],
      "minimum-stability": "dev"
    }

The root required packageB that requires packageA, but the packageB says that can't find packageA in the matching conditions.

What I'm doing wrong?

Thanks a lot since now.

解决方案

I found the proper solution.

Here's what I did.

First:

But the real solution was, as I was working with my own private package, I was using bitbucket to host the two packages, pointing the repos in the "repositories" field inside my composer.json inside of the root composer and the packageB composer.

And that is what was wrong.

As described in this link, the composer's root package has to include the link of all the repos inside the repositories field.

Being just like so:

The root package short version of my composer.json

{
  "require": {
    "packageB/packageB": "dev-master"
  },
  "repositories": [
    {
      "type": "vcs",
      "url":  "[email protected]:packageB/packageB.git"
    },
    {
      "type": "vcs",
      "url":  "[email protected]:packageA/packageA.git"
    }
  ],
  "minimum-stability": "dev"
}

The packageA short version of my composer.json

{
    "require": {

    }
}

The packageB short version of my composer.json

{
  "require": {
    "packageA/packageA": "dev-master"
  }
}

Hope it works, because it worked for me. Peace out!

这篇关于如何解决作曲家的“足够稳定的版本中不可用的包"错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 04:23