Reputation: 33
I have 2 composer packages I created and I want to use the first package inside the second package, and I want to use the second package in my main app.
Now when I run composer update
my main app can see the 2nd package, but 2nd package can't see the first package.
The error im getting is:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for mycompany/package1 dev-branch1 -> satisfiable by mycompany/package1[dev-branch1].
- mycompany/package1 dev-branch1 requires mycompany/package2 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 see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.
- It's a private package and you forgot to add a custom repository to find it
Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
But when I run composer install
in the 2nd package there is no problem and it installs the 1st package to 2nd package.
So is there a way to install a package, which is dependent to another custom package?
Upvotes: 0
Views: 640
Reputation: 126
If you add the 2nd package directly on the main project does it install? Composer cannot chain load dependencies on its own as described here.
https://getcomposer.org/doc/faqs/why-can%27t-composer-load-repositories-recursively.md
Like the documentation says, in case of private packages, you must use Satis or a private Packagist instance for this use case
Upvotes: 1