Reputation: 1756
My package was working in private repository in Giblab, and after importing it in Github it's not working, When I try to require it, i've a error :
[InvalidArgumentException] Could not find a matching version of package lib_externe/XXX. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability ( dev).
This is my package composer.json :
{
"name": "lib-externe/XXX",
"description": "Lib metier V4",
"license": "proprietary",
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0"
}
}
Composer.json on the front side is :
{
"repositories": {
"lib_externe": {
"type": "git",
"url": "https://xxx:[email protected]/zzz/zzz.lib_externe.git"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"lib-externe/XXX": "dev-master",
}
}
I've try to add those 2 lines that I didn't have before, but it's not helping:
"minimum-stability": "dev",
"prefer-stable": true,
Another interesting thing, is, if I remove vendor directory and composer.lock, and if I do a composer install, it work, and I see my lib-externe folder in vendor. But after imposible to require (this command was working in gitlab) :
composer require lib_externe/XXX:dev-master
When I execute this commande line, i've "minimum-stability" error. I've try lot of different variant with @dev for exemple, but nothing helped
Verbose mode :
...
Reading composer.json of lib-externe/XXX (wip/HJ_ms_url_landing_maker)
Reading /root/.composer/cache/repo/XXXXXXXXXXXXXXXX from cache
Importing branch wip/HJ_ms_url_landing_maker (dev-wip/HJ_ms_url_landing_maker)
Downloading https://repo.packagist.org/packages.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2018-04.json from cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2018-07.json from cache
Downloading http://repo.packagist.org/p/provider-2018-10%24ea06f25637c1c602d41ed345c80a660576d10be05261f8108e936462757cdd1f.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2018-10.json into cache
Downloading http://repo.packagist.org/p/provider-2019-01%2489609fdd5aed8f456ecfe99afda1ac8b789147473448122af24d6c5104615a76.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2019-01.json into cache
Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-archived.json from cache
Downloading http://repo.packagist.org/p/provider-latest%249fafea8edeb232d8a026fe8fd8d1cbacbc6be44e759a39ed975e02facb658be1.json
Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-latest.json into cache
Downloading https://packagist.org/search.json?q=lib_externe/XXX&type=
[InvalidArgumentException]
Could not find a matching version of package lib_externe/XXX. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (
dev).
Exception trace:
() at phar:///usr/local/bin/composer/src/Composer/Command/InitCommand.php:740
...
i've try to "composer clear-cache" If I clone URL in "url" repository of composer.json, it clone correctly, and in Log in verbose mode I see all my branches (master included) If I check cached file, I see the package composer.json :
{"name":"lib-externe\/XXX","description":"Lib metier V4","license":"proprietary","minimum-stability":"dev","require":{"php":">=5.4.0"},"time":"2018-04-16T10:40:23+00:00"}
I don't have Tag, and I would like to don't use them if possible for now !
Until Now in Gitlab it was working in this way,
Thank you !
Upvotes: 11
Views: 15782
Reputation: 1756
The problem was just a mistake in package name ('_' instead of '-') :
composer require lib_externe/XXX:dev-master
Correct name is :
composer require lib-externe/XXX:dev-master
Upvotes: 8