Could not find a version of package matching your minimum-stability. Require it with an explicit version constraint allowing its desired stability

Could not find a version of package matching your minimum-stability. Require it with an explicit version constraint allowing its desired stability

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Resolving "Could not find a version matching your minimum-stability"

When attempting to install a new package via Composer, encountering an InvalidArgumentException regarding stability is a frequent stumbling block. The specific error message—Could not find a version of package matching your minimum-stability (dev)—indicates a mismatch between the stability levels declared in your local configuration and those available for the target package on Packagist.

In the scenario presented, the user created a library named innovareti/password-policy. Despite verifying that the package exists on Packagist and checking the GitHub repository, the installation fails immediately upon running composer require innovareti/password-policy. The root cause lies not in the availability of the package metadata, but in how Composer interprets stability constraints based on the composer.json configuration.

Understanding Stability Constraints

Composer operates on a strict hierarchy of stability levels: stable, dev, and alpha (among others). By default, Composer assumes that any dependency requires a stable version unless explicitly told otherwise. This is why your local composer.json for the package itself includes "minimum-stability": "dev". This declaration tells Composer that when resolving dependencies for this specific project, it should accept dev versions.

However, this setting has no bearing on what stability level the package author expects their own dependency to satisfy. When you run composer require innovareti/password-policy, Composer looks up the latest version of innovareti/password-policy on Packagist. If that version is tagged as a development release (indicated by a dev- prefix or a pre-release tag), but your root composer.json defaults to requiring stability stable, Composer will reject it.

The error message explicitly suggests the solution: Require it with an explicit version constraint allowing its desired stability. This means you must instruct Composer to look for dev versions when fetching this specific package, regardless of your project's global default.

Explicitly Requesting Dev Versions

To resolve this, you have two primary options depending on your intent. If the library is truly in a development phase and you intend to use that unstable version:

  1. Use an Explicit Stability Constraint:
    Append @dev to the package name during installation. This overrides the default stability check for that specific dependency only.

    composer require innovareti/password-policy:@dev
    
  2. Add a Specific Version Constraint:
    If you have a specific version tag in mind (e.g., 1.0.0-dev), you can specify it directly:

    composer require innovareti/password-policy:1.0.0-dev
    

This approach ensures that Composer bypasses the standard stability filter for this package while maintaining your project's global default settings for other dependencies. This is often the cleanest way to handle pre-release libraries without polluting your lock file with unnecessary configuration changes.

Verifying Packagist and Repository Alignment

The source material notes that the user sees the package on Packagist but still receives an error. This discrepancy usually stems from one of two issues:

  • Local Cache: Composer caches metadata locally to speed up lookups. If the repository was updated recently, your local cache might still contain old information indicating a different stability level or version. Running composer clear-cache followed by the require command can force a fresh lookup.
  • Version Tagging: Even if the package is visible on Packagist, if the latest release is not tagged as stable, Composer will default to rejecting it unless you use the methods described above. Ensure that the version being pushed to Packagist aligns with the intended stability. For instance, if you want a stable release, ensure the tag does not include -dev or alpha.

Best Practices for Stability Management

While setting "minimum-stability": "dev" in your package's composer.json is valid for development projects, it is important to understand that this does not automatically propagate stability requirements to consumers of your package. Each consumer (your current user) must explicitly opt-in to dev versions if the dependency is unstable.

If you are distributing a library that you intend to be stable once released, ensure your latest tag on GitHub corresponds to a stable version in Packagist. If you are actively developing features and need user feedback, using @dev constraints allows users to access your work-in-progress without forcing them to alter their entire project's stability baseline.

For further guidance on managing dependencies and understanding the nuances of Composer configuration, resources like https://laravelcompany.com offer additional context on building robust PHP applications.

Our network