0

I had 10.6.2 working - on Centos 7 and today it is just GONE. I had to remove phpunit and apparently it took the drush pathing setup for drush with it. Now it says it is installed but the command is not found if I run " composer require drush/drush:10.6.2 "

If I go to /public_html/vendor/drush/drush and run ./drush it is there but gives the error " ! [NOTE] Drupal root not found. Pass --root or a @siteAlias in order to see Drupal-specific commands. "

How do I get this pathed back to the drupal root ??

4
  • 1
    Don't go to Drush, go to your web root, as in cd web/ and then type ../vendor/drush/drush/drush cr or install the Drush Launcher on your machine to just do drush cr.
    – leymannx
    Jan 19, 2022 at 21:00
  • ./vendor/drush/drush/drush cr rebuilt the cache, but did not fix the path problem (one dot from webroot) Jan 19, 2022 at 21:21
  • 2
    Execute the command from within the directory where Drupal's index.php file is located – the web root. Not the project root. See drupal.stackexchange.com/q/309223/15055. What command are you executing exactly when the error gets raised?
    – leymannx
    Jan 19, 2022 at 21:36
  • ./vendor/drush/drush/drush cr means it IS executed from the Drupal root where index.php is. drush cr is short for drush cache-rebuild, it does not fix pathing; howeveer I think I see what happened. I use RPM files where possible for global installation files. I had drush-8.1.16-1.el7.remi.noarch.rpm installed which included phpunit 5.7 so I uninstalled it to install phpunit9.by rpm, but it did not upgrade phpunit 5, and that took "drush.launcher" off which was somehow launching 10.6.2 from the command line anywhere. I will have to hack it back onto the server to get "drush.launcher" back Jan 20, 2022 at 10:36

2 Answers 2

1

Best solution was to straight use Drush Launcher ( https://github.com/drush-ops/drush-launcher ) If you use WinSCP it is really easy to move it into the path, rename it "drush", make it executable and it will find the version of drush when executed via command line from inside the Drupal installation. The nice thing is there can be different versions of drush in different Drupal verson installations - like version 8 drush installed in Drupal 7 and inside that Drupal it will use that version of drush installed Fast and easy

0

Make sure you have a composer.json file in the site root.

If there is no composer.json you always get the error "! [NOTE] Drupal root not found. Pass --root or a @siteAlias in order to see Drupal-specific commands. "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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