Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub composer package - minimum-stability

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 !

like image 596
NicoMinsk Avatar asked Mar 21 '19 19:03

NicoMinsk


People also ask

What is composer minimum stability?

An alternative is to set your minimum-stability to dev, but tell composer you want to use stable whenever possible: "minimum-stability": "dev", "prefer-stable" : true. This basically means it will always use stable UNLESS there is no way to install a stable dependency, and therefore use dev.

How do I get the composer JSON file?

To configure Composer for your PHP app json file specifies required packages. Verify that a composer. json file is present in the root of your git repository. Run composer install (on your local machine) to install the required packages and generate a composer.

What is root composer json?

The root package is the package defined by the composer. json at the root of your project. It is the main composer. json that defines your project requirements. Certain fields only apply when in the root package context.

What is the use of composer JSON file?

composer. json is a JSON file placed in the root folder of PHP project. Its purpose is to specify a common project properties, meta data and dependencies, and it is a part of vast array of existing projects.


1 Answers

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
like image 114
NicoMinsk Avatar answered Nov 07 '22 05:11

NicoMinsk