【发布时间】:2018-12-23 15:45:31
【问题描述】:
首先,有一些相关的帖子并不真正适合我的问题。
- Composer won't install dependency
- Composer not installing local package dependencies
- Composer not installing dependencies of Package
还有更多。
我有一个包含一些私有包的 Symfony 项目。 这些都是vcs引用的:
"repositories": [
{
"type": "vcs",
"url": "git@aaaaa.git"
},
{
"type": "vcs",
"url": "git@xxxxx.git"
},
{
"type": "vcs",
"url": "git@yyyyy.git"
}
],
这按预期工作。但是,私有包 yyyy 引用了另一个私有包(我们称之为 sub-yyyy),该私有包也被包 composer.json 文件中的 vcs 类型引用。
如果我运行 composer install 它会失败并显示以下消息:
问题 1 - yyyy 的安装请求 -> yyyy]。 - yyyy 需要 sub-yyyy ^1.0.0 -> 找不到匹配的包。
潜在原因:
- 包名有错别字
- 根据您的最低稳定性设置,该软件包在足够稳定的版本中不可用,请参阅 https://getcomposer.org/doc/04-schema.md#minimum-stability 了解更多 详情。
- 这是一个私有包,您忘记添加自定义存储库来查找它
私有包(子yyyy)是v1.0.0标记的,如果它在主项目的composer.json文件中就可以安装。
主项目的composer.json(需要剪掉):
{
"name": "main/project",
"license": "proprietary",
"type": "project",
"prefer-stable": true,
"repositories": [
{
"type": "vcs",
"url": "git@aaaaa.git"
},
{
"type": "vcs",
"url": "git@xxxxx.git"
},
{
"type": "vcs",
"url": "git@yyyyy.git"
}
],
}
yyyy包的composer.json:
{
"name": "yyyy",
"type": "symfony-bundle",
"require": {
"sub-yyyy": "^1.0.0"
},
"repositories": [
{
"type": "vcs",
"url": "git@sub-yyyy.git"
}
],
"minimum-stability": "dev",
}
当我安装引用sub-yyyy 的yyyy 包时,有什么想法可以解决这个问题吗?
【问题讨论】:
标签: symfony composer-php