1

I Installed drush8 via composer for drupal 8. I have updated .bashsrc file with export PATH="$HOME/.composer/vendor/bin:$PATH". But still when I try to execute drush command, terminal is showing "command not found"

Ashwin Geet D'Sa
  • 6,346
  • 2
  • 31
  • 59
Max28
  • 11
  • 1
  • 3
  • Did you source your bashrc again so that the changes apply to your current terminal session? – Secespitus Sep 06 '19 at 08:01
  • Drupal 8.4+ requires Drush 9, see https://docs.drush.org/en/master/install/#drupal-compatibility – leymannx Sep 06 '19 at 08:08
  • And `Drush only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency.` – leymannx Sep 06 '19 at 08:09
  • You have to run the command `source ~/.bashrc`, then the changes in bashrc files will be reflected. – Ashwin Geet D'Sa Sep 06 '19 at 08:09
  • @leymannx i installed drush 9, but it showed compatbility error, so i changed it to version 8 – Max28 Sep 06 '19 at 09:01
  • @AshwinGeetD'Sa yes i ran the command `source ~/.bashrc`.. im wondering whether the path given is correct or not. `which $SHELL` gives me **\bin\bash** and `echo $PATH` gives me **$HOME/usr/local/bin/composer/vendor/bin** – Max28 Sep 06 '19 at 09:06

2 Answers2

0

Try this, If Drush already installed check using $which drush This will show you the current drush path something like ~/vendor/drush/drush

If you don't have drush installed you can add using $ composer global require drush/drush

Add path to your .bashrc file. PATH=$PATH:$HOME/bin:/home/currentusername/vendor/drush/drush

Export PATH

save you changes and exit the terminal and relogin to validate your drush works from anypath.

Narayan P
  • 139
  • 1
  • 3
0
export PATH="$HOME/.config/composer/vendor/bin:$PATH"

source ~/.bashrc
saqib
  • 111
  • 2
  • 5