1

Does anyone know why Drush doesn't recognize the Drupal 7 installation when I run drush cache:clear?

It gives me the following error message.

Command cache-rebuild requires Drupal core version 8+ to run.

drush status and drush -d give me the right root and right configuration.

I installed Drush with composer require "drush/drush": "7.x-dev".

  • What does which drush and drush --version return you? You also should better use Drush 8. composer require drush/drush:^8.0. – leymannx Nov 4 at 13:57
1

As @leymannx said in the comments you should better use drush 8 since it's the recommended version for a drupal 7 site (https://www.drush.org/install/#drupal-compatibility).

If drush --version returns something else than 7.x-dev it means you're using another drush than the one you think. You can go in your website /web directory and execute ../vendor/bin/drush cc to use the one you installed for this project.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.