I am trying to add a local project A as dependency to project B. Using git daemon
I am able to fetch project A as dependency, but the dependencies defined with require
in the composer.json in project A are not recognized. What am I missing?
project A:
{
"name": "project/a",
"require": {
"monolog/monolog": "dev-master"
}
}
project B:
"repositories": [
{
"type": "vcs",
"url": "git://localhost/home/user/project-a"
}
],
"require": {
"project/a": "dev-master"
}
result (in project B):
vendor/
project/a
expected:
vendor/
project/a
monolog/monolog
Double-check you don't have typos in your composer. json or repository branches and tag names. Be sure to set the right minimum-stability. To get started or be sure this is no issue, set minimum-stability to "dev".
To update dependencies two commands can be used: composer update and composer require . The difference between these two commands is that composer update will try to update a dependency based on the current constraints in composer. json and will only update composer. lock .
Composer will look in all your repositories to find the packages your project requires. By default, only the Packagist.org repository is registered in Composer. You can add more repositories to your project by declaring them in composer. json .
The most likely explanation is that you forgot to commit the changes to your composer.json
in /home/user/project-a
.
To debug this you can use composer show project-a dev-master -v
. The -v
will output more verbose info while it loads the repository, and then you will see details about the version you are installing, if it does not contain the monolog require, then I would say my guess above was correct. If it does contain it, we got a serious bug in composer and you should report it on github.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With