-1

Using ddev I created a webserver locally and I have a Drupal 8 project with drush 10, but I need drush 9. How can I change the version of drush in the project? Thanks so much

rfay
  • 9,963
  • 1
  • 47
  • 89
AndreaAmb
  • 1
  • 1
  • 1
    Does this answer your question? [How to install a specific version of package using Composer?](https://stackoverflow.com/questions/40914114/how-to-install-a-specific-version-of-package-using-composer) – leymannx May 04 '20 at 12:04
  • I used the command "composer require drush/drush:9" in the home directory. I run the drush --version command and the answer was "Drush Launcher Version: 0.6.0 Drush Commandline Tool 9.0.0." I run the command in the webroot and e restitusce Launcher Version: 0.6.0 Drush Commandline Tool 10.0.0 – AndreaAmb May 04 '20 at 12:39
  • Please update your question accordingly. And when you are inside the container run `cd web && ../vendor/drush/drush/drush --version` instead. – leymannx May 04 '20 at 12:45
  • I run the command cd web && ../vendor/drush/drush/drush --version and the answer was Drush Commandline Tool 10.2.2 – AndreaAmb May 07 '20 at 17:18

1 Answers1

1

As @leymannx says in the comments, this isn't really a ddev question, it's a composer question, but it's easy.

ddev composer require "drush/drush:^9" will get the most recent Drush 9 version.

But I should mention that it's unlikely that you actually need Drush 9, Drush 10 is what most people are using with Drupal 8 and 9.

rfay
  • 9,963
  • 1
  • 47
  • 89