I've created a package (innovareti/password-policy
) and now I am trying to install it, but it is not 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 ocurring)
It does have a tag and a release, and I've updated it in packagist but it's still not working, even after the update on packagist is done already for a couple of minutes and I can see it there fine.
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 at: https://github.com/innovareti/password-policy
I've tried many things I saw online but nothing worked, can anyone help me?
Apparently the problem was that new packages published to packagist need to be installed with composer on version 21.
I ran composer selfupdate --2
to update my version of composer which was 1.x.
Then required my package by running composer require innovareti/password-policy
and it worked.
Further References