root composer.json需要软件包开发,找到的软件包,但不匹配约束
我为我想使用作曲家安装的GitHub repo foo/bar分叉。
我添加了
{
"require": {
foo/bar": "dev-develop"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/myuser/bar"
}
]
}
我的bar
叉有一个分支开发
。 当我运行作曲家安装
时,我会得到:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires foo/bar dev-develop, found foo/bar[dev-main, v0.1.0] but it does not match the constraint.
I forked a GitHub repo foo/bar that I want to install using composer.
I added
{
"require": {
foo/bar": "dev-develop"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/myuser/bar"
}
]
}
My bar
fork has a branch develop
.
When I run composer install
, I get:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires foo/bar dev-develop, found foo/bar[dev-main, v0.1.0] but it does not match the constraint.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
今天我一直在与非常相似的事情作斗争。我解决的方式是通过删除composer.json文件中的“版本”属性,并在Github中使用我定位的版本编号创建版本。
因此,使用上面的示例,从开发分支(例如:v0.1)中在github 中创建一个版本,然后在应用程序中的composer.json中要求该发行版在调用中可以解决问题。
I have been battling something very similar for awhile today. The way I got around it was by removing the "version" property in the composer.json file and creating a release in github with the version number I was targeting.
So using the example above, creating a release in github from the develop branch (for example: v0.1) and then requiring that in the composer.json in the application calling it might do the trick.
我对吉特拉布有同样的问题。我需要发布带有功能分支名称的作曲家软件包。你应该尝试一下。
I had the same problem with gitlab. I needed to publish a composer package with the name of my feature branch. You should try that.
作曲家找不到
开发
分支。它确实找到了main
分支和标签v0.1.0
,但没有开发
。检查作曲家真的在看您的分叉仓库:
寻找一些输出,显示出您的foo/bar的叉子。
Composer cannot find the
develop
branch. It did find themain
branch and tagv0.1.0
, but nodevelop
.Check that composer is really looking at your forked repo:
and look for some output that shows it looked into your fork of foo/bar.