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.
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.
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.
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
Commented
Jan 31, 2018 at 17:16
For Ubuntu
export PATH="$HOME/.composer/vendor/bin:$PATH"
source $HOME/.bashrc
composer global require drush/drush:8.x
export PATH="$HOME/.config/composer/vendor/bin/:$PATH"
Commented
Jul 18, 2021 at 7:40
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.