0

I have successfully installed Drupal 8 with Composer and I also installed Drush with Composer. When I use Drush, it says that the Drupal root is not found. I am passing the root, but it still says that.

How do I tell Drush where the root directory is?

I am using Drush from vendor/drush/drush/drush. I couldn't get vendor/bin/drush to work.

  • What does drush status report ? post it in your question above. – GiorgosK Mar 25 at 18:25
2

When I run:

$ composer create-project drupal-composer/drupal-project:8.x-dev drupal-project-test-site --no-interaction
$ cd drupal-project-test-site
$ vendor/bin/drush status

Then I see:

 Drupal version : 8.6.13                                                                  
 Site URI       : http://default                                                          
 PHP binary     : /usr/local/Cellar/php/7.3.0/bin/php                                     
 PHP config     : /usr/local/etc/php/7.3/php.ini                                          
 PHP OS         : Darwin                                                                  
 Drush script   : .../drupal-project-test/drupal-project-test-site/vendo 
                  r/drush/drush/drush                                                     
 Drush version  : 9.6.0                                                                   
 Drush temp     : /tmp                                                                    
 Drush configs  : .../.drush/drush.yml                                       
                  .../drupal-project-test/drupal-project-test-site/vendo 
                  r/drush/drush/drush.yml                                                 
                  .../drupal-project-test/drupal-project-test-site/drush 
                  /drush.yml                                                              
 Drupal root    : .../drupal-project-test/drupal-project-test-site/web   
 Site path      : sites/default                                                           

Drush should be able to find the Drupal root for the site that it's contained inside without the use of --root or an alias. I'm not sure why vendor/bin/drush would not work. Perhaps try again with a new test project, and see whether you get the same results? Perhaps your install did not complete.

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.