Composer – Requested Package exists as but these are rejected by your constraint

Today I got a strange error within a composer updatewhich I can’t describe myself.

{
   "repositories": {
       "my-plugin": {
           "type": "vcs",
           "url": "git@mycodebase.com:mjplug/myplugin.git"
       }
    },
   "require": {
        "my-plugin/myplugin": "0.0.9",
   }    
}

When I try composer update then I’ll get

The requested package my-plugin/my-plugin 0.0.9 exists as my-plugin/my-plugin[0.0.6, 0.0.5] but these are rejected by your constraint.

But there exists tags like 0.0.7, 0.0.8, 0.0.9 in the repository. Why aren’t they found?

If I set ~0.0.1 as version constraint it works because composer will install 0.0.6.

Any hints? Thank you

EDIT: Here is a Screenshot of our Bitbucket Server Instance: http://imgur.com/a/m8lRT

EDIT 2: SOLVED: In some last release I put the composer.json for some reason to a sub-directory. So this was the problem that composer couldn’t find the latest tags.

  • PHPUnit on pre-commit Git Hook seems to use different PHP version
  • How to setup a basic symfony2 project after cloning it from github
  • What's the most compact way to store diffs in a database?
  • How can I use git to automatically keep all Laravel sites in production updated?
  • Does using git for deploy have any distinct advantages over sending .tar.gz?
  • Vagrant provisioning and version control
  • can you make my life easier working this way? (large code base and patching issue)
  • Smarty as a submodule
  • 3 Solutions collect form web for “Composer – Requested Package exists as but these are rejected by your constraint”

    Composer allows using branches as versions by specifying them as dev-, so dev-master relates to master branch. If you want to specify a specific tag, it goes like

    "author/package": "dev-master#v1.1.0"
    

    Also see the link:

    LINK

    Reference

    As of described on Composer documentation i would update your tags to: v0.0.7, v0.0.8, v0.0.9 on your master branch. Thus should help composer follow what is said:

    Composer first asks the VCS to list all available tags, then creates an internal list of available versions based on these tags. In the above example, composer’s internal list includes versions 1.0, 1.0.1, 1.0.2, the beta release of 1.1, the first and second release candidates of 1.1, the final release version 1.1, etc…. (Note that Composer automatically removes the ‘v’ prefix in the actual tagname to get a valid final version number.

    Once those tags on your master, your "my-plugin/myplugin": "0.0.9" or "my-plugin/myplugin": "0.0.*" etc should work properly.

    Because WordPress Plugin Files need to be in a subfolder I put all files including composer.json to a subdirectory and pushed a new version.

    Later I tried to install the new version inside my project and the new version(s) weren’t found. This was the issue. The composer.json needs to be in root. (Stupid me)

    Useful Command:
    composer show myplugin/myplugin

    Git Baby is a git and github fan, let's start git clone.