1

I am trying to install drush on my new computer and it's a mess
I'm on Mac Os High Sierra, with Mamp 5.3, PHP 7.2.14

I'm mainly interested in Drupal 7
On my previous computer, it was simple i just had to be on the htdocs folder and type : drush dl to download the latest Drupal 7 release

Now i had to install composer (v1.8.4) and then installed drush using this command : composer require drush/drush:dev-master
I ended up with this version of drush (v9.7.0-dev)
When i type drush dl i get this message :

dl has been deprecated. Please build your site using Composer. Add new projects with composer require drupal/[project-name]. Use https://www.drupal.org/project/composer_generate to build a composer.json which represents the enabled modules on your site.

I'm no advanced user (obviously), i just need drush to have persmission to execute basic commands to install a new drupal 7, install, enable, disable modules..

Here's the result of $PATH

Mac:htdocs Mac$ $PATH
-bash: /Users/Mac/.composer/vendor/bin:/Applications/MAMP/bin/php/php7.2.14/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin: No such file or directory

Thanks

1

If you read the Drupal compatibility table in the docs, you'll see that the correct version for Drupal 7 is Drush 8. The installation instructions for Drush 8 are simple and clear, no Composer required - just download a phar file.

PS! If you are planning on maintaining Drupal 8 sites (with Drush 9) too, I recommend getting Drush Launcher.

  • I was reading this documentation page : docs.drush.org/en/master/install . Yours seem to be the appropriate one, thanks. Can i leave the drush 9.7.0-dev or should i uninstall it ? (if so, how ?) – NSTK Mar 26 at 22:06
  • You should uninstall it. You can just replace it with the current version by running composer require drush/drush. This will install the current version of Drush. But note that with drupal 8, you cannot download modules with Drush anymore, you need to use Composer to download modules now. – Jaypan Mar 26 at 22:21
  • The poster is asking specifically about Drupal 7 ... Regarding uninstalling the Drush (that was installed using Composer) - read drupal.stackexchange.com/questions/135599/… NB! If/when you are using Drupal 8, you should install Drush site-local, not globally. So no matter what you do, just remove the global Drush. – hansfn Mar 26 at 23:05

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.