4

I'm trying to install drush 8 via composer:

composer global require drush/drush:dev-master (source)

but it gives me drush version 7.0.0 which is without D8 integration... I'm using Linux Mint 17.

  • Just saying: dev-master used to be drush 8, but I think now it is drush 9. Which is unsuitable for Drupal 7. Maybe this needs an update? – donquixote Oct 23 '17 at 20:47
4

composer require drush/drush:dev-master gave me Drush 8 three days ago when I ran this tutorial to setup different versions of Drush on my system http://www.jpstacey.info/blog/2014-04-07/switching-between-drush-major-versions

Multiple versions of Drush can be useful if a site is no longer in development and for example custom drush commands were created for a specific version of Drush.

  • Not work for me too, but marked as accepter. I've ended using vagrant VDD box for D8 – Codium Aug 3 '15 at 10:39
  • 2
    dev-master will install beyond Drush 8 now (Drush 9 at time of writing). From my experience, Drush 9 appears to be incompatible with Drupal 7 also mentioned here. So if you want Drush 8 (or 8.1) which does work with Drupal 7 then do composer require drush/drush:~8 - see: drupal.stackexchange.com/a/200547/1082 – therobyouknow Jan 31 '18 at 17:16
2

I also find that composer require drush/drush:dev-master (n.b. deliberate removal of global option), ran in a directory without a composer.json file did in fact pull down the 'master' branch of Drush, which is Drush 8, just as the documentation says. As an experiment, you might want to try running the same command (without global) in an empty directory, and see if you get the right version of Drush in that instance.

If that is working for you, then perhaps you have an older version of Drush in your global vendor directory ($HOME/.composer/vendor/drush/drush). It is possible that Composer might become confused by this, as 'dev-master' did at one time refer to the 7.x branch. I did not attempt to reproduce this situation, and tend to think that in most cases you should still get the 'master' branch. However, if you are having trouble, you might try composer global remove drush/drush, and then re-install as you did before, and see if this fixes the problem. You might also try composer self-update, in case you have an old composer.

1

For Ubuntu

export PATH="$HOME/.composer/vendor/bin:$PATH"
source $HOME/.bashrc
composer global require drush/drush:8.x

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.