How to solve the error "package not available in the version with a stable enough version" of the composer?

I recently researched Composer's minimal stability a lot. I got into the official documentation and read about the change in minimum stability. But even in this case, I can’t get the composer to install the dependencies.

I have a root package and two others, call them packageA and packageB. When I needed package B in the root package, package B should carry package A with it, but that is when I get the error.

Your requirements cannot be resolved to an installed set of packages.

Problem 1

  • The installation request for packageB / packageB dev-master → is doable by packageA / packageA [dev-master].
  • packageB / packageB dev-master requires packageA / packageA dev-master → no matching package was found.

Potential reasons:

  • Type in package name
  • The package is not available in a sufficiently stable version in accordance with the minimum stability setting.

Short version of the root package of my composer.json

     {
       "require": {      
         "packageB / packageB": "dev-master"
       },
       "repositories": [
         {
           "type": "vcs",
           "url": " git@bitbucket.org : packageB / packageB.git"
         }
       ],
       "minimum-stability": "dev"
     }

Batch short version of my composer.json

     {
       "require": {      

       },
       "minimum-stability": "dev"
     }

Short version of packageB of my composer .json

     {
       "require": {      
         "packageA / packageA": "dev-master"
       },
       "repositories": [
         {
           "type": "vcs",
           "url": " git@bitbucket.org : packageA / packageA.git"
         }
       ],
       "minimum-stability": "dev"
     }

A root package that requires packageA, but packageB says that it cannot find packageA in matching conditions.

What am I doing wrong?

Thanks a lot since then.

+6
source share
2 answers

I found the right solution.

Here is what I did.

Firstly:

I removed the minimum stability field inside the .json composer from my packages A and B; Since minimal stability is the root field. As described in [link] https://getcomposer.org/doc/04-schema.md#minimum-stability ).

But the real solution was that when I was working with my own personal package, I used a bitpack to host the two packages, specifying the repositories in the “repositories” box inside my composer.json inside the root composer and package B the composer.

And that was not so.

As described in this link, the composer's root package should include a link to all repositories within the repositories field.

To be the same:

Short version of the root package of my composer.json

{ "require": { "packageB/packageB": "dev-master" }, "repositories": [ { "type": "vcs", "url": " git@bitbucket.org :packageB/packageB.git" }, { "type": "vcs", "url": " git@bitbucket.org :packageA/packageA.git" } ], "minimum-stability": "dev" } 

Batch short version of my composer.json

 { "require": { } } 

Short version of packageB of my composer .json

 { "require": { "packageA/packageA": "dev-master" } } 

Hope this works because it worked for me. Peaceful!

+12
source

change the minimum stability to dev from stability, for example:

 "minimum-stability": "dev", 
+1
source

All Articles