git 如何解决composer的'package not available in stable-enough version'错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22536978/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to solve the 'package not available in stable-enough version' error of composer?
提问by user3396974
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.
最近,我一直在做很多关于 Composer 最小稳定性的研究。我进入官方文档并阅读有关最低稳定性更改的信息。但是,即便如此,我也无法让 Composer 安装依赖项。
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.
我有根包和另外两个,我们称它们为 packageA 和 packageB。当我需要根包中的 packageB 时,packageB 必须随身携带 packageA,但那是我收到错误的时候。
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for packageB/packageB dev-master -> satisfiable by packageA/packageA[dev-master].
- packageB/packageB dev-master requires packageA/packageA dev-master -> no matching package found.
Potential causes:
- A type in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting.
无法将您的要求解析为一组可安装的软件包。
问题一
- packageB/packageB dev-master 的安装请求 -> packageA/packageA[dev-master] 可满足。
- packageB/packageB dev-master 需要 packageA/packageA dev-master -> 没有找到匹配的包。
潜在原因:
- 包名称中的类型
- 根据您的最低稳定性设置,该软件包没有足够稳定的版本。
The root package short version of my composer.json
我的 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
包我的 composer.json 的简短版本
{ "require": { }, "minimum-stability": "dev" }
The packageB short version of my composer.json
我的 composer.json 的 packageB 简短版本
{ "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.
root 需要 packageB 需要 packageA,但是 packageB 说在匹配条件中找不到 packageA。
What I'm doing wrong?
我做错了什么?
Thanks a lot since now.
从现在开始非常感谢。
回答by user3396974
I found the proper solution.
我找到了正确的解决方案。
Here's what I did.
这就是我所做的。
First:
第一的:
I removed the minimum-stability field inside the composer.json of my packages A and B; For the minumum-stability is a root-only field. As, described in this [link] https://getcomposer.org/doc/04-schema.md#minimum-stability).
我删除了包 A 和 B 的 composer.json 中的 minimum-stability 字段;因为 minumum-stability 是一个 root-only 字段。如本 [链接] https://getcomposer.org/doc/04-schema.md#minimum-stability 中所述)。
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.
但真正的解决方案是,当我使用自己的私有包时,我使用 bitbucket 来托管这两个包,将 repos 指向我的 composer.json 内的“repositories”字段中的根作曲家和 packageB 作曲家。
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
我的 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
包我的 composer.json 的简短版本
{
"require": {
}
}
The packageB short version of my composer.json
我的 composer.json 的 packageB 简短版本
{
"require": {
"packageA/packageA": "dev-master"
}
}
Hope it works, because it worked for me. Peace out!
希望它有效,因为它对我有用。安息吧!
回答by iltaf khalid
change minimum stability to dev from stability like:
将最小稳定性从稳定性更改为 dev,例如:
"minimum-stability": "dev",