Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Linda Maya's avatar

Error while installing a package through composer

Hello,

I have some problems with installing a package, that I would like to share with you.

Here is the command

composer require modelizer/selenium "~2.0"

Then I get this;

./composer.json has been updated
Running composer update modelizer/selenium
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - modelizer/selenium[v2.0, ..., v2.0.2] require guzzlehttp/guzzle ^6.2 -> found guzzlehttp/guzzle[6.2.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.0.1).
    - Root composer.json requires modelizer/selenium ~2.0 -> satisfiable by modelizer/selenium[v2.0, v2.0.1, v2.0.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Fine, it tells me to command something like this;


composer require modelizer/selenium "~2.0" --with-all-dependencies (-W)


I do. Then it returns this:


  [InvalidArgumentException]
  Could not find a matching version of package (-W). Check the package spelling, your version constraint and that the
   package is available in a stability which matches your minimum-stability (dev).


Might be simple for you. But hard for me to solve. Do you have any idea?

0 likes
11 replies
MichalOravec's avatar

In your composer change version of guzzle to

"guzzlehttp/guzzle": "^6.3",

then I think it will work.

Linda Maya's avatar

Do you mean in vendor/composer/InstalledVersions.php file?

There is something like this :


 'guzzlehttp/guzzle' => 
    array (
      'pretty_version' => '7.2.0',
      'version' => '7.2.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '0aa74dfb41ae110835923ef10a9d803a22d50e79',
    ),


Linda Maya's avatar

Yes updated as such "guzzlehttp/guzzle": "^6.3", . tried with the composer and gave the results below :

For:

composer require modelizer/selenium "~2.0"
./composer.json has been updated
Running composer update modelizer/selenium
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires guzzlehttp/guzzle ^6.3, found guzzlehttp/guzzle[6.3.0, ..., 6.5.x-dev] but the package is fixed to 7.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 2
    - modelizer/selenium[v2.0, ..., v2.0.2] require guzzlehttp/guzzle ^6.2 -> found guzzlehttp/guzzle[6.2.0, ..., 6.5.x-dev] but the package is fixed to 7.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires modelizer/selenium ~2.0 -> satisfiable by modelizer/selenium[v2.0, v2.0.1, v2.0.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

For:

composer require modelizer/selenium "~2.0" --with-all-dependencies (-W)


  [InvalidArgumentException]
  Could not find a matching version of package (-W). Check the package spelling, your version constraint and that the
   package is available in a stability which matches your minimum-stability (dev).


require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--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] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...
abhijeet9920's avatar

@linda maya ,

You're project has installed guzzlehttp/guzzle with version 7, but in composer.json for medilizer/selenium it is 6.2. You can change that composer.json with guzzlehttp/guzzle.

Linda Maya's avatar

Unfortunately, changing guzzlehttp/guzzle , in composer.json did not work.

Linda Maya's avatar

Does this have something to do with the following statement?


... but the package is fixed to 7.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

and should I change something in the composer.lock file?

frankielee's avatar

Delete the composer.lock file and the vendor directory. After that, try again with the command composer update

1 like
MichalOravec's avatar

After changing version of guzzle in composer.json run

composer update

and then install that package what you want.

1 like
Linda Maya's avatar

I am sure I am on the right track. However now, it warns me about another package called spatie/crawler that requires guzzlehttp/guzzle^7.2 if I understanding in a correct way.

Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - spatie/crawler[6.0.0, ..., v6.x-dev] require guzzlehttp/guzzle ^7.2 -> found guzzlehttp/guzzle[dev-master, 7.2.0, 7.3.0, 7.4.x-dev (alias of dev-master)] but it conflicts with your root composer.json require (^6.3).
    - Root composer.json requires spatie/crawler ^6.0 -> satisfiable by spatie/crawler[6.0.0, 6.0.1, 6.0.2, v6.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

I was thinking.., Would it be the best way to install modelizer/selenium package to an empty project? Or is there a workaround to this?

Please or to participate in this conversation.