作曲家-找不到匹配的软件包 [英] Composer - No Matching Package Found
问题描述
我有一个已构建的PHP框架,并且我试图将所有内容分离到不同的存储库中,并在composer中对其进行设置,以使我的生活更轻松.
I have a PHP framework I've built, and I'm trying to separate everything into different repos and get it set up in composer to make my life easier.
基本上,我有3个问题在讨论:一个是用于集合类的集合类,该集合类用作集合数据类型("liftkit/collection")的基类,另一个是用于输入变量的包装器("liftkit/input",取决于集合存储库),第三个用于核心("liftkit/core",取决于输入包装器.
Basically, I have 3 repos in question: one is for a collection class that serves as a base class for collection data types ("liftkit/collection"), another is a wrapper for input variables ("liftkit/input", which depends on the collection repo), and a third that is for the core ("liftkit/core", which depends on the input wrapper.
当我在"liftkit/input"上运行 composer update
时,它会安装"liftkit/collection"并可以正常工作,但是当我在"liftkit/core"上运行它时,出现以下错误:
When I run composer update
on "liftkit/input", it installs "liftkit/collection" and works fine, but when I run it on "liftkit/core" it gives me the following error:
问题1-liftkit/input [dev-master]可以满足liftkit/input @dev->的安装请求.-liftkit/input dev-master需要liftkit/collection dev-master->找不到匹配的软件包.
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文件:
Here are my composer.json files:
{
"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"
}
]
}
任何帮助将不胜感激.谢谢.
Any help is greatly appreciated. Thanks.
推荐答案
像composer一样,它不会递归地解析存储库.从文档中:
Looks like composer won't resolve repositories recursively. From the docs:
存储库不是递归解析的.您只能将它们添加到您的主要composer.json.依赖项的存储库声明composer.jsons被忽略.
Repositories are not resolved recursively. You can only add them to your main composer.json. Repository declarations of dependencies' composer.jsons are ignored.
所以我想我很走运.我必须在每个存储库中指定存储库.
So I guess I'm out of luck. I'll have to specify the repositories in each repo.
这篇关于作曲家-找不到匹配的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!