phpsymfonysymfony-flex

InvalidArgumentException when trying to install a symfony flex package


I just installed symfony and symfony flex via composer require symfony/flex but symfony flex aliases don't work. For example, when I try to install twig by doing composer require twig, I receive this answer :

Info from https://repo.packagist.org: #StandWithUkraine

[InvalidArgumentException]
Could not find package twig.

Did you mean one of these?
twig/twig
latte/latte
slim/twig-view
twig/extensions
twig/intl-extra

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [- -update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--igno re-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUT OLOADER-PREFIX] [--] []...

How can I solve this problem ?


Solution

  • The problem came from my composer version, once it was upgraded, the symfony flex aliases worked.