Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using composer.json with private repositories (without using Packagist)
This is mostly a note to my own bad memory. I hope somebody else can use it, too.
When using composer to manage packages, and one or more of these packages (including the root project itself) is not registered on Packagist, then you must include an entry in the "repositories" array in your composer.json.
I am pretty sure this must be noted somewhere in the documentation, but I was not able to find it.
Example:
{
"name": "vendor/PackageA",
"require": "vendor/PackageB",
"repositories": [
{
"type": "vcs",
"url": "git@github.com:vendor/PackageA.git"
},
{
"type": "vcs",
"url": "git@github.com:vendor/PackageB.git"
}
]
}
I was hinted in this direction by this SO question: https://stackoverflow.com/questions/22536978/how-to-solve-the-package-not-available-in-stable-enough-version-error-of-compo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.