Score:0

Drush commands not defined - drush 11.4.0 drupal 9.5.1

in flag

This configuration is working properly on xampp local install (drush version)

Drupal version : 9.5.1 DB driver : mysql DB hostname : localhost DB port : 3306 Database : Connected Drupal bootstrap : Successful PHP binary : C:/xampp/php/php.exe PHP config : C:/xampp/php/php.ini PHP OS : WINNT PHP version : 7.4.27 Drush script : C:/xampp/htdocs/mysite/vendor/drush/drush/drush Drush version : 11.4.0

But on webserver, any drush command I type (for example cr) returns a "Command "cr" is not defined." Drush was installed via composer global require drush/drush (also exists as vendor/bin/drush in website root with same behavior)

drush list returns :

Available commands: help Display help for a command list List commands I think I have pretty much the same config on another webserver with no such problem. Any ideas on that ?

id flag
Global Drush installs are not supported.
leymannx avatar
ne flag
Drush only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency. https://www.drush.org/latest/install/
Score:2
de flag

Drush used to be installed globally, but that will no longer work. Instead, Drush LAUNCHER is installed globally. This creates a global drush command, however it does not contain the Drush code itself. The Drush code is instead added to each project on a per-project basis, managed using composer. When calling drush, Drush Launcher will take your current working directory, determine if it is a Drupal installation, and if it is, look for Drush in the vendor folder, and execute that on the current Drupal installation.

duck avatar
in flag
Thank you Jaypan. I actually did it this way (but as I got The issue described above, I tried to add Drush globally also with no luck. But yes, drush launcher is in usr/local/bin and drush itself in my project root vendor folder. All files seems ok). Not sure what to do
Jaypan avatar
de flag
Please re-read. Drush is NOT installed globally, and Drush launcher is NOT installed per-project. That is backwards. Drush launcher is installed globally, and Drush is launched on a per-project basis.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.