I am using a Windows computer and using Git Bash, I just installed a new 8.8.1 site and also did 'composer require drush/drush'. I can't use Drush from anywhere so I am wondering if I should have installed Drush globally on the computer.

  • what do you use locally: xampp, wampp or damp (drupal acquia dev desktop) ? – Nathan Jan 6 at 20:16
  • 1
    Yes, because it lives in the vendor directory and CLI does not know what you mean as just drush, so you'd have to use the launcher/wrapper, or refer to it by path like ../../vendor/bin/drush (command)... – Kevin Jan 6 at 20:24
  • @Nathan I am using WAMP, meanwhile I got it to work by using its path as ../vendor/bin/drush {command} I also have Acquia Dev Desktop installed but for some reasons I need to use WAMP this time. ADD has Drush bundled and works seamlessly in Windows. – Chike Jan 8 at 11:09
  • @Kevin Thanks, I will use its path as it will suffice for now. – Chike Jan 8 at 11:20

No, you don't install Drush globally anymore. You install the Drush Launcher instead. It will provide you a global drush command that automagically uses the local Drush from each project.

Drush Launcher

A small wrapper around Drush for your global $PATH.

  • Thanks @leymannx but I will actually prefer to have Drush per project, I won't mind moving into any folder within each project to run it. But in this case, having ran 'composer require drush/drush' I can't use Drush from any folder within the project. – Chike Jan 6 at 20:21
  • @Chike – You have Drush per project. And then you have Drush Launcher to launch each project's Drush when you somewhere in your project type $ drush cr or whatever. So instead of typing $ ../../../vendor/bin/drush cr or similar the Drush Launcher will do that for you. – leymannx Jan 6 at 20:33
  • I just found it in the path ../vendor/bin/drush It's Version 10.1.1. Trying to use drush updb or drush cr throws this error Command drush was not found. Drush was unable to query the database. As a r esult, many commands are unavailable. Re-run your command with --debug to see relevant log messages. – Chike Jan 6 at 21:02
  • running drush --debug shows this Exception trace: at C:\wamp64\www\folder\vendor\drush\drush\src\Application.php:239 Drush\Application->bootstrapAndFind() at C:\wamp64\www\folder\vendor\drush\drush\src\Application.php:192 Drush\Application->find() at C:\wamp64\www\folder\vendor\symfony\console\Application.php:236 Symfony\Component\Console\Application->doRun() at – Chike Jan 6 at 21:04
  • C:\wamp64\www\folder\vendor\symfony\console\Application.php:148 Symfony\Component\Console\Application->run() at C:\wamp64\www\folder\vendor\drush\drush\src\Runtime\Runtime.php:118 Drush\Runtime\Runtime->doRun() at C:\wamp64\www\folder\vendor\drush\drush\src\Runtime\Runtime.php:49 Drush\Runtime\Runtime->run() at C:\wamp64\www\folder\vendor\drush\drush\drush.php:72 require() at C:\wamp64\www\folder\vendor\drush\drush\drush:4 – Chike Jan 6 at 21:05

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