简体   繁体   English

根 composer.json 需要 package dev-develop,找到 package 但它与约束不匹配

[英]Root composer.json requires package dev-develop, found package but it does not match the constraint

I forked a GitHub repo foo/bar that I want to install using composer.我分叉了一个 GitHub 存储库 foo/bar,我想使用 composer 安装它。

I added我添加了

{
    "require": {
        foo/bar": "dev-develop"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/myuser/bar"
        }
    ]
}

My bar fork has a branch develop .我的bar fork 有一个分支develop When I run composer install , I get:当我运行composer install时,我得到:

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 had the same problem with gitlab.我对 gitlab 有同样的问题。 I needed to publish a composer package with the name of my feature branch.我需要以我的功能分支的名称发布一个作曲家 package。 You should try that.你应该试试。

Composer cannot find the develop branch. Composer 找不到develop分支。 It did find the main branch and tag v0.1.0 , but no develop .它确实找到了main分支和标签v0.1.0 ,但没有找到develop

found foo/bar[dev-main, v0.1.0]找到 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.并寻找一些 output 显示它查看了您的 foo/bar 叉。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么Symfony Flex在composer.json的根目录级别添加自己的“ dev-develop”捆绑包? - Why does Symfony Flex adds own “dev-develop” bundles to root level in composer.json? Composer需要apigility才能找到软件包bshaffer / oauth2-server-php:dev-develop,即使它明显在packagist上也是如此 - Composer require apigility cant find package bshaffer/oauth2-server-php:dev-develop even though it's clearly on packagist package.json 和 composer.json 是一样的吗? - Is the same a package.json and a composer.json? 依赖包中的Composer.json不应修改 - Composer.json in dependency package should not be modified 我可以用 composer.json 为我的 package 指定一个根文件夹(相对于项目根文件夹)吗? - May i specify a root folder (relative to project root folder) for my package with composer.json? 使用 type=package 对 composer.json 存储库进行完整性检查 - Integrity checks for composer.json repositories with type=package 如何使用composer.json从软件包安装特定文件 - How to install specific files from a package using composer.json 在 composer.json 中,有没有办法指定用于单个 package 的存储库? - In composer.json is there a way to specify the repo to use for an individual package? Composer.json需要我自己的私有软件包 - Composer.json require my own private package 防止 package 包含嵌入式 composer.json 的提供程序定义 - Prevent a package from including the provider definition of the embedded composer.json
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM