Skip to main content

Each time I worked through the process of installing Drush I would check that had installed by running the command drush --version.  However, my response was

drush --version

Command 'drush' not found, did you mean:

  command 'rush' from deb rush (1.8+dfsg-1.1)

Try: apt install <deb name>

 

Yet if I ran the command:

composer global require drush/drush

The output would be 

Changed current directory to /home/fdrc_drupal_dev/.config/composer
Using version ^10.5 for drush/drush
./composer.json has been updated
Running composer update drush/drush
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove

 

The response above tells me that Drush is installed.  As it is using version ^10.5.  However, it isn't being found.  So clearly, I had the wrong path for my .bashrc file.

Most tutorials I found were telling me to use the following for my PATH.

export PATH="$HOME/.config/composer/vendor/bin:$PATH"

However, this cannot be correct.  I ran a find query to see what paths existed.

sudo find / -name drush -type d

The paths I was most interested in were

/home/{name}/.config/composer/vendor/drush
/home/{name}/.config/composer/vendor/drush/drush

export PATH="$HOME/.config/composer/vendor/drush/drush:$PATH"

On changing this path, when I now run the command

drush --version

The response is now:

Drush Commandline Tool 10.5.0