尽管在包的 Github 分支中有标签,但在作曲家中获取“找不到包的版本..”

San*_*nde 2 php git composer-php packagist

我正在学习如何在 packagist.org 上上传包。我创建了一个用于使用 composer.json 文件进行测试的 github 存储库 - https://github.com/perials/check 和一个使用此 github 存储库的 composer 包 - https://packagist.org/packages/perials/check

当我尝试使用安装此软件包时出现composer require perials/check以下错误

[InvalidArgumentException]                                              
Could not find a version of package perials/check matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.
Run Code Online (Sandbox Code Playgroud)

根据我在关于 SO 的其他相关问题中读到的内容,如果 github 分支没有稳定版本,则会发生此错误。但问题是我已经有一些版本了。

我也试过composer require perials/check:dev-mastercomposer require perials/check:7.1.0但后来我得到以下错误

[InvalidArgumentException]             
Could not find package perials/check.  

Did you mean this?                     
perials/check
Run Code Online (Sandbox Code Playgroud)

Md *_*sir 9

这是新加坡镜像的包装商元数据问题。现在应该解决了。https://github.com/composer/composer/issues/8347#issuecomment-537176755

如果仍然不能解决您的问题,请添加"minimum-stability": "dev"您的 composer.json

{
    "name": "perials/check",
    "description": "Package for testing packagist",
    "license": "MIT",
    "authors": [
        {
            "name": "Perials",
            "email": "info@perials.com"
        }
    ],
    "autoload": {
        "psr-4": {"Abc\\": "src/xyz"}
    },
    "require": {},
    "minimum-stability": "dev"
}
Run Code Online (Sandbox Code Playgroud)