gpt4 book ai didi

git - Composer - 找不到匹配的包

转载 作者:太空狗 更新时间:2023-10-29 12:58:02 24 4
gpt4 key购买 nike

我有一个自己构建的 PHP 框架,我正在尝试将所有内容分离到不同的存储库中,并在 composer 中进行设置,以使我的生活更轻松。

基本上,我有 3 个 repo 协议(protocol):一个是作为集合数据类型基类的集合类(“liftkit/collection”),另一个是输入变量的包装器(“liftkit/input”,这取决于集合 repo ),第三个用于核心(“liftkit/core”,这取决于输入包装器。

当我在“liftkit/input”上运行 composer update 时,它会安装“liftkit/collection”并且工作正常,但是当我在“liftkit/core”上运行它时,它会出现以下错误:

Problem 1 - Installation request for liftkit/input @dev -> satisfiable by liftkit/input[dev-master]. - liftkit/input dev-master requires liftkit/collection dev-master -> no matching package found.

这是我的 composer.json 文件:

{
"name": "liftkit/collection",
"description": "LiftKit base class for collections",
"license": "LGP-2.1",
"autoload": {
"psr-4": {
"LiftKit\\": "src/"
}
},
"require": {
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
}
}

{
"name": "liftkit/input",
"description": "LiftKit input wrappers",
"license": "LGP-2.1",
"autoload": {
"psr-4": {
"LiftKit\\": "src/"
}
},
"require": {
"liftkit/collection": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/liftkit/collection"
}
]
}

{
"name": "liftkit/core",
"description": "LiftKit Core Libraries",
"license": "LGP-2.1",
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"LiftKit\\": "src/"
}
},
"require": {
"liftkit/input": "dev-master",
"liftkit/dependency-injection": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/liftkit/input"
},
{
"type": "git",
"url": "https://github.com/liftkit/dependency-injection"
}
]
}

非常感谢任何帮助。谢谢。

最佳答案

看起来 composer 不会递归地解析存储库。来自文档:

Repositories are not resolved recursively. You can only add them to your main composer.json. Repository declarations of dependencies' composer.jsons are ignored.

所以我想我运气不好。我必须在每个存储库中指定存储库。

关于git - Composer - 找不到匹配的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28567656/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com