PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 19, 2022

[FIXED] How can I install fpoirotte/cryptal with composer?

 February 19, 2022     composer-php, php     No comments   

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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing