root composer.json需要软件包开发,找到的软件包,但不匹配约束

发布于 2025-02-12 21:01:11 字数 621 浏览 0 评论 0原文

我为我想使用作曲家安装的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

从﹋此江山别 2025-02-19 21:01:11

今天我一直在与非常相似的事情作斗争。我解决的方式是通过删除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.

潇烟暮雨 2025-02-19 21:01:11

我对吉特拉布有同样的问题。我需要发布带有功能分支名称的作曲家软件包。你应该尝试一下。

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.

时光暖心i 2025-02-19 21:01:11

作曲家找不到开发分支。它确实找到了main分支和标签v0.1.0,但没有开发

找到foo/bar [dev-main,v0.1.0]

检查作曲家真的在看您的分叉仓库:

composer require -vvv "foo/bar dev-develop"

寻找一些输出,显示出您的foo/bar的叉子。

Composer cannot find the develop branch. It did find the main branch and tag v0.1.0, but no develop.

found foo/bar[dev-main, v0.1.0]

Check that composer is really looking at your forked repo:

composer require -vvv "foo/bar dev-develop"

and look for some output that shows it looked into your fork of foo/bar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文