Composer/Packagist could not find package for minimum stability

Composer/Packagist could not find package for minimum stability

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

Stefan Bogdanescu

Founder & Senior Architect

The minimum-stability Trap in Local Development

When attempting to install a custom package via Composer, encountering an InvalidArgumentException stating that the package could not be found for your minimum-stability is a classic symptom of a misconfigured local repository or a misunderstanding of how Composer resolves versions. In the specific case where you are trying to install cr/hashcli, the error message explicitly points to the mismatch between the stability level required by your global configuration and the stability of the package version available in your repository.

The core issue usually lies in the distinction between packages hosted on Packagist versus those stored in local repositories like vendor/ or a custom ./packages directory defined in composer.json. When you run composer require cr/hashcli, Composer queries the configured repositories to find the package. If this is a private package located locally (often in a packages folder) and not yet uploaded to Packagist, it defaults to dev stability or alpha/beta/rc depending on how it was pushed.

However, if your global composer.json file contains "minimum-stability": "stable", Composer will ignore any versions marked as dev, alpha, beta, RC, or nightly. This is a strict filter designed to ensure production environments only pull stable, release-tagged code. If your local package has not been tagged with a standard version number like 1.0.0 in the root directory of that specific repository folder, Composer treats it as an unstable development version. Consequently, even if the spelling is correct and the path exists in the local repo, the stability check fails immediately.

To resolve this without altering your global security posture, you must adjust the stability requirement specifically for the installation command or update the package metadata. The most direct fix when installing a custom tool locally is to use the --dev flag with the require command:

composer require cr/hashcli --dev

Adding --dev tells Composer to bypass the minimum-stability filter and allow the installation of development versions, which includes local packages that haven't been formally released. Alternatively, if you intend for this package to be available in stable environments eventually, you should ensure that a release tag exists on the package source code. Creating a tag (e.g., git tag -a 0.1.0) and pushing it updates the version metadata on Packagist or your local repository to reflect a stable release, satisfying the default stable requirement without needing workarounds.

Another potential pitfall involves the configuration of repositories in the root composer.json. If cr/hashcli is expected to be found via Packagist but hasn't been uploaded there yet, you must explicitly define the local path as a repository source:

"repositories": [
    {
        "type": "path",
        "url": "../packages/cr-hashcli"
    }
]

Without this definition, Composer searches Packagist first. If the package is missing from Packagist (which it would be if you haven't uploaded it), and you haven't defined a local path repository, Composer might simply fail to find the package entirely rather than reporting a stability error. However, if the stability error persists after defining the repository, the minimum-stability filter remains the culprit.

It is also worth noting that changing "minimum-stability": "stable" in your root composer.json globally affects every project you work on. If this is a development environment where you frequently use pre-release tools, it is often better to keep global stability strict and pass --dev or --ignore-platform-reqs (if applicable) only when necessary, or create a dedicated development profile in your config files.

For production-grade workflows, the best practice is to maintain a clear separation between development versions and stable releases. If you are building a tool for end-users who will install it via Composer without knowing about your local setup, uploading the package to Packagist with a proper version tag is mandatory. The minimum-stability check exists to prevent accidental dependencies on incomplete code, so respecting it by tagging releases ensures that your tools are robust and predictable.

Our network