Andrew Fletcher published: 11 September 2023 (updated) 29 September 2023 1 minute read
Resources - changing Drush
| Type | Version |
|---|---|
| Drush (current) | 11.6.0 |
| Drush (update) | 12.2.0 |
Updating Drush went OK on all testing environments until on to the staging environment.
The initial error that I saw was
PHP Fatal error: Declaration of Drush\Style\DrushStyle::confirm($question, $default = true) must be compatible with Symfony\Component\Console\Style\SymfonyStyle::confirm(string $question, bool $default = true): bool in /var/www/html/{project}/vendor/drush/drush/src/Style/DrushStyle.php on line 11Followed by attempting to run composer update
Your requirements could not be resolved to an installable set of packages.
Problem 1
- drush/drush[12.0.0, ..., 12.2.0] require composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint.
- Root composer.json requires drush/drush ^12 -> satisfiable by drush/drush[12.0.0, ..., 12.2.0].To resolve this problem, update your composer by running the following command:
composer self-update
Comparing the Composer versions
| Environment | Version |
|---|---|
| Local | 2.5.2 2023-02-04 14:33:22 |
| Ubuntu server | 2.1.5 2021-07-23 10:35:47 |
Ubuntu server Composer version post running the self-update command
2.6.2 2023-09-03 14:09:15