Here is the log:
public_html]$ composer2 require 'drupal/counter:^1.3'
./composer.json has been updated
Running composer update drupal/counter
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 drupal/counter ^1.3 -> satisfiable by drupal/counter[1.3.0].
- drupal/counter 1.3.0 requires matomo/device-detector ^5.0.3 -> found matomo/device-detector[5.0.3, 5.0.4, 5.0.5] but the package is fixed to 6.4.7 (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.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.
I installed Matomo 8.x-1.26 but no joy.
What to do? Thanks!
Comments
Comment #2
medha kumariHi,
The issue is a dependency conflict with the matomo/device-detector package. The Counter module requires version ^5.0.3,
but your system has version 6.4.7 locked in the composer.lock file.
Here are the solutions in order of preference:
Solution 1: Update with all dependencies
composer require 'drupal/counter:^1.3' --with-all-dependencies
This allows Composer to downgrade the matomo/device-detector package to be compatible with the Counter module.
Solution 2: Update specific packages
composer update drupal/counter matomo/device-detector
Solution 3: If the above don't work, force update
composer require 'drupal/counter:^1.3' --update-with-all-dependencies
The Matomo module you installed (8.x-1.26) is separate from the matomo/device-detector PHP library that's causing the conflict.
The Counter module needs the older version of this library to function properly.
Try Solution 1 first - it should resolve the dependency conflict by allowing the necessary package downgrades.
Comment #3
lambert commentedThanks!!