Issue
I can't install https://packagist.org/packages/fpoirotte/cryptal. Per packagist.org I should be able to do composer require fpoirotte/cryptal
via the CLI but whenever I try to do so I get the following error:
[InvalidArgumentException]
Could not find package fpoirotte/cryptal.
Did you mean one of these?
fpoirotte/cryptal
fpoirotte/cryptal-hash
fpoirotte/cryptal-sodium
fpoirotte/cryptal-mcrypt
fpoirotte/cryptal-openssl
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
I'm able to install other composer packages without issue. It's just this one that's having issues..
Solution
The default minimum stability for composer is "stable".
From the docs:
"minimum-stability" (root-only): This defines the default behavior for filtering packages by stability. This defaults to stable, so if you rely on a dev package, you should specify it in your file to avoid surprises.
And on the other hand, the package you are trying to install only has a "master" branch and no version tags, so it is considered a "dev" dependency.
You have to options to install this package:
Edit your composer.json to include:
"minimum-stability": "dev",
Although this changes your minimum stability requirements for the whole project, so it may not be ideal.
Require a specific version
If you do composer require fpoirotte/cryptal:master-dev
you'll be able to install this package keeping your minimum-stability settings to stable
.
I do not know what version of composer you are running, but it may be worth to update it. The error I get with my version is much more explicit:
[InvalidArgumentException]
Could not find a version of package fpoirotte/cryptal matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.
Answered By - yivi
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.