Install drush globally using composer on WSL

With reference to my previous post, Setup development environment for Drupal on windows 10, I noticed that installing drush on WSL using composer doest work by default, in this post I am going to demonstrate how to install drush globally using composer on WSL.

I am assuming you have composer install, in order to install drush we have to follow below mentioned steps:


  $ composer global require drush/drush
  

Now check drush installed path by running:


  $ composer config --global home
  

This will print path for drush currently install i.e. /home/my-user-name/.config/composer, now we have to set this in PAHT so that drush command can be run from anywhere, using command replace my-user-name with your own:


  $ echo 'export PATH="/home/my-user-name/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc
  $ source ~/.bashrc
  

Now check that drush command is working by running


  $ drush
  

Comments

Popular posts from this blog

How to setup Drupal 8 Multisite on nginx webserver with different domain.

Drupal views create exposed filter programmatically