我的程序包正在Giblab的私有存储库中工作,并且在Github中将其导入后无法正常工作, 当我尝试要求它时,我出现了错误:
[InvalidArgumentException]找不到匹配的版本 软件包lib_externe / XXX。检查包裹的拼写,您的版本 约束,并且该软件包的稳定性 匹配您的最小稳定性(dev)。
这是我的包composer.json:
{
"name": "lib-externe/XXX",
"description": "Lib metier V4",
"license": "proprietary",
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0"
}
}
Composer.json在正面是:
{
"repositories": {
"lib_externe": {
"type": "git",
"url": "https://xxx:yyy@github.com/zzz/zzz.lib_externe.git"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"lib-externe/XXX": "dev-master",
}
}
我尝试添加以前没有的那两行,但这无济于事:
"minimum-stability": "dev",
"prefer-stable": true,
另一个有趣的事情是,如果我删除了供应商目录和composer.lock,并且执行了composer安装,那么它将正常工作,并且我在供应商中看到了lib-externe文件夹。但是在无法要求之后(此命令在gitlab中起作用):
composer require lib_externe/XXX:dev-master
执行此命令行时,出现“最小稳定性”错误。 例如,我尝试使用@dev做很多不同的变体,但没有帮助
详细模式:
...
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
...
我尝试“组成者清除缓存” 如果我在composer.json的“ URL”存储库中克隆URL,它将正确克隆,并且在以详细模式登录时,我会看到我的所有分支(包括主服务器) 如果我检查了缓存的文件,则会看到包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"}
我没有标签,如果可能的话,我现在不希望使用它们!
直到现在在Gitlab中,它都是以这种方式工作的,
谢谢!
答案 0 :(得分:0)
问题仅仅是软件包名称(用'_'而不是'-')的错误:
composer require lib_externe/XXX:dev-master
正确的名称是:
composer require lib-externe/XXX:dev-master