我的软件包在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,并且如果我进行了作曲家安装,则它可以工作,并且我会在供应商中看到我的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中,它一直在这种方式工作,
谢谢!
这个问题只是软件包名称中的一个错误('_'而不是' - '):
composer require lib_externe/XXX:dev-master
正确的名称是:
composer require lib-externe/XXX:dev-master