我已经创建了一个包(innovareti/password-policy
),现在我尝试安装它,但找不到:
$ composer require innovareti/password-policy ... [InvalidArgumentException] Could not find a version of package innovareti/password-policy matching your minimum-stability (dev). Require it with an explicit version constraint allowing its desired stability.
(此错误不断发生)
它确实有一个标签和一个版本,我已经在 packagist 中更新了它,但它仍然无法工作,即使在 packagist 上的更新已经完成几分钟之后,我可以在那里很好地看到它。
这是包的composer.json:
{ "name": "innovareti/password-policy", "description": "A library to intuitively create password policies and validate a subject against them.", "autoload": { "psr-4": { "PasswordPolicy\Tests\": "tests/", "PasswordPolicy\": "src/PasswordPolicy/", "PasswordPolicy\Database\Factories\": "database/factories", "PasswordPolicy\Models\": "src/Models" } }, "extra":{ "laravel": [ "src/PasswordPolicy/Providers/Laravel/PasswordPolicyServiceProvider" ] }, "require": { "php": "^5.5" }, "scripts": { "test": "vendor/bin/phpunit", "test-f": "vendor/bin/phpunit --filter" }, "minimum-stability": "dev" }
我的存储库位于:https://github.com/innovareti/password-policy
我尝试了很多网上看到的方法,但没有任何效果,有人可以帮助我吗?
P粉3203612012023-10-26 09:42:25
显然,问题在于发布到 packagist 的新软件包需要与版本 21 上的 Composer 一起安装。
我运行了composer selfupdate --2
来更新我的composer版本,即1.x。
然后通过运行 composer require innovareti/password-policy
来获取我的包并且它起作用了。
进一步参考