I have created a package (innovareti/password-policy
) and now I try to install it but it cannot be found:
$ 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.
(This error keeps happening)
It does have a tag and a version and I've updated it in packagist but it still doesn't work even though a few minutes after the update on packagist has finished I can see it fine there.
This is the composer.json of the package:
{ "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" }
My repository is located at: https://github.com/innovareti/password-policy
I have tried many methods I saw online, but nothing works. Can anyone help me?
P粉3203612012023-10-26 09:42:25
Apparently the problem is that new packages published to packagist need to be installed with Composer on version 21.
I ran composer selfupdate --2
to update my composer version, which is 1.x.
Then got my package by running composer require innovareti/password-policy
and it worked.
Further Reference