Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve the 'package not available in stable-enough version' error of composer?

Recently, I've been doing a lot of research about Composer minimum-stability. I get into the official documentation and read about the minimum-stability change. But, even so I cant get the composer to install the dependencies.

I have the root package and two others, let's call them packageA and packageB. When I required the packageB in the root package, the packageB has to bring with him the packageA, but that's when i'm getting the error.

Your requirements could not be resolved to an installable set of packages.

Problem 1

  • Installation request for packageB/packageB dev-master -> satisfiable by packageA/packageA[dev-master].
  • packageB/packageB dev-master requires packageA/packageA dev-master -> no matching package found.

Potential causes:

  • A type in the package name
  • The package is not available in a stable-enough version according to your minimum-stability setting.

The root package short version of my composer.json


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

The packageA short version of my composer.json


    {
      "require": {      

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

The packageB short version of my composer.json


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

The root required packageB that requires packageA, but the packageB says that can't find packageA in the matching conditions.

What I'm doing wrong?

Thanks a lot since now.

like image 501
user3396974 Avatar asked Mar 20 '14 15:03

user3396974


1 Answers

I found the proper solution.

Here's what I did.

First:

I removed the minimum-stability field inside the composer.json of my packages A and B; For the minumum-stability is a root-only field. As, described in this [link] https://getcomposer.org/doc/04-schema.md#minimum-stability).

But the real solution was, as I was working with my own private package, I was using bitbucket to host the two packages, pointing the repos in the "repositories" field inside my composer.json inside of the root composer and the packageB composer.

And that is what was wrong.

As described in this link, the composer's root package has to include the link of all the repos inside the repositories field.

Being just like so:

The root package short version of my composer.json

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

The packageA short version of my composer.json

{
    "require": {      

    }
}

The packageB short version of my composer.json

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

Hope it works, because it worked for me. Peace out!

like image 62
user3396974 Avatar answered Oct 07 '22 14:10

user3396974