Composer-在开发中安装本地软件包时出现相关性错误 [英] Composer - installing local packages in development with dependencies error
问题描述
我使用路径在composer中有本地存储库软件包,并且它们仍在开发中.问题是,安装它时出现了错误.
I have local repositories packages in composer, using path, and they are still in development. The thing is, it's given me an error installing it.
错误消息:
使用包信息加载composer存储库
更新依赖关系(包括require-dev)
您的要求无法解决为一组可安装的软件包.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
问题1:
- 对供应商/packageB的安装请求*->可由供应商/packageB [dev-master]满足.
- 供应商/程序包B开发主管需要供应商/程序包A开发主管->未找到匹配的软件包.
潜在原因:
- 包裹名称中的错字
- 根据您的最低稳定性设置,该软件包无法提供足够稳定的版本
因此,请解释一下我所拥有的.
So to explain what I have, consider this.
第一个软件包安装名为packageA的依赖项.一切都按预期进行.请参见下面的 composer.json
文件摘录:
The first package, installs the dependency that is called packageA. And every thing works as expected.
See extract of the composer.json
file below:
[
"name": "vendor/packageB",
"repositories": [
{
"type": "path",
"url": "/vendor/packageA/"
}
],
"require": {
"vendor/packageA": "*"
},
"minimum-stability": "dev"
]
第二个软件包,我想安装packageB及其依赖项(在本例中为packageA).这是一个错误.请参见下面的 composer.json
文件摘录:
And second package, that i would like to install the packageB and its dependencies (in this case packageA). This is here it gives an error.
See extract of the composer.json
file below:
[
"name": "vendor/packageC",
"repositories": [
{
"type": "path",
"url": "/vendor/packageB/"
}
],
"require": {
"vendor/packageB": "*"
},
"minimum-stability": "dev"
]
可能无法在composer中使用本地开发依赖项,目前我还不太清楚.
Probably is not possible to use local development dependencies in composer, this is not very clear to me at the moment.
所以,我的怀疑是,这与以下情况有关:
So, my doubts is, this is something to do with:
- 最小稳定度",可能是因为这全是"dev"?
- 还是因为我使用本地软件包(不在packagist或github上)?
- 还是别的(错别字:))?
当我放入packageA时,我也设法将其安装,也作为packageB的依赖项.那是我发现它起作用的唯一方法.
I have manage to install it when I put the packageA, also as dependency of packageB. That was the only way that I have found it works.
感谢您的帮助!
推荐答案
在作曲家常见问题中对此问题进行了描述. https://getcomposer.org/doc/常见问题解答/为什么不能以递归方式编写作者负载存储库.md
This issue is described in the composer FAQs. https://getcomposer.org/doc/faqs/why-can't-composer-load-repositories-recursively.md
在您的情况下,这意味着 packageC
的composer.json必须包含在哪里找到 packageA
的存储库的信息:
In your case this means, that the composer.json of packageC
has to include the info where to find the repository for packageA
:
[
"name": "vendor/packageC",
"repositories": [
{
"type": "path",
"url": "/vendor/packageB/"
},
{
"type": "path",
"url": "/vendor/packageA/"
}
],
"require": {
"vendor/packageB": "*"
},
"minimum-stability": "dev"
]
这篇关于Composer-在开发中安装本地软件包时出现相关性错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!