A package version matching your minimum stability was not found. Require it to have explicit version constraints to achieve its required stability
P粉763662390
P粉763662390 2023-10-25 12:40:18
0
1
537

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粉763662390
P粉763662390

reply all(1)
P粉320361201

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.


  1. CompareDeprecated Packagist .org support for Composer 1.x ( Jordi Boggiano for packagist.org; February 2021)

Further Reference

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!