3
votes

I have a project that depends on a local package which in itself depends on another local pakcage.

Project

{
...
  "repositories": [
    {
      "packagist": false
    },
    {
      "type": "vcs",
      "url": "/path/to/local/package1"
    },
  ],  
  "require": {
    "local/package1": "dev-master"
  }
...
}

Package 1

{
...
  "repositories": [
    {
      "packagist": false
    },
    {
      "type": "vcs",
      "url": "/path/to/local/package2"
    },
  ],  
  "require": {
    "local/package2": "dev-master"
  }
...
}

When I do a composer install on package1, everything works as expected, packages2 is found and is installed. But when I do it on project it cannot find package2 with this error:

 Problem 1
    - Installation request for local/package1 dev-master -> satisfiable by local/package1[dev-master].
    - local/package1 dev-master requires local/package2 dev-master -> no matching package found.
1
The problem is not that the recursive repository definitions are not allowed as mentioned in the answer below, but even when you copy the repository definition from the "child" to the "parent", it won't accept it and won't find it still. And now I am curious how they are going to explain this, that this is not a bug, but a feature, at least it's not finished functionality then imo.FantomX1

1 Answers

2
votes

From Composer manual:

Repositories are only available to the root package and the repositories defined in your dependencies will not be loaded. Read the FAQ entry if you want to learn why.