0
votes

I have local repositories packages in composer, using path, and they are still in development. The thing is, it's given me an error installing it.

Error message:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1:

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

Potential causes:

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

So to explain what I have, consider this.

The first package, installs the dependency that is called packageA. And every thing works as expected. See extract of the composer.json file below:

[
    "name": "vendor/packageB",
    "repositories": [
        {
            "type": "path",
            "url": "/vendor/packageA/"
        }
    ],
    "require": {
        "vendor/packageA": "*"
    },
    "minimum-stability": "dev"
]

And second package, that i would like to install the packageB and its dependencies (in this case packageA). This is here it gives an error. See extract of the composer.json file below:

[
    "name": "vendor/packageC",
        "repositories": [
            {
                "type": "path",
                "url": "/vendor/packageB/"
            }
        ],
        "require": {
            "vendor/packageB": "*"
        },
        "minimum-stability": "dev"
]

Probably is not possible to use local development dependencies in composer, this is not very clear to me at the moment.

So, my doubts is, this is something to do with:

  • "minimum-stability", probably because this is all "dev"?
  • or because I am using local packages (not on packagist or github)?
  • Or is something else (other than a typo :) )?

I have manage to install it when I put the packageA, also as dependency of packageB. That was the only way that I have found it works.

Thanks for any help!

1
is that above the complete error message? i think it is the missing repository for packageA inside your packageC. Maybe composer skips this repositories section of dependencies because this could cause security issuesNorman M
I have update the error message, so now this is complete error message @NormanM .user38561

1 Answers

0
votes

This issue is described in the composer FAQs. https://getcomposer.org/doc/faqs/why-can't-composer-load-repositories-recursively.md

In your case this means, that the composer.json of packageC has to include the info where to find the repository for packageA:

[
"name": "vendor/packageC",
    "repositories": [
        {
            "type": "path",
            "url": "/vendor/packageB/"
        },
        {
            "type": "path",
            "url": "/vendor/packageA/"
        }
    ],
    "require": {
        "vendor/packageB": "*"
    },
    "minimum-stability": "dev"
]