search

Home  >  Q&A  >  body text

A package version matching your minimum stability was not found. Require it to have explicit version constraints to achieve its required stability

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粉763662390P粉763662390415 days ago632

reply all(1)I'll reply

  • P粉320361201

    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.


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

    Further Reference

    reply
    0
  • Cancelreply