English version was created automatically using Drupal module auto_node_translate and free DeepL translator.
Drush launcher can't find drush in Drupal 10 installation
zveřejněno 2023-08-10
I've always used drush-laucher to make it easier to run drush than typing vendor/drush/drush every time. But in the latest combination of Drupal 10 and drush 12, it doesn't work.
As usual I install Drupal (latest version Drupal 10.1) using composer composer create-project drupal/recommended-project:10.1.0 "install-dir". I installed drush (version 12.1.2) in the same way: composer require drush/drush.

Running drush status but only showed an error message
The Drush launcher could not find a local Drush in your Drupal site.
Please add Drush with Composer to your project.
Run 'cd "/var/www/install-dir" && composer require drush/drush'
drush-launcher does not support Drush 12 required for Drupal 10
After a bit of searching, I came across the right information about the problem.
As it says here drush-launcher 0.10.2 not working with drupal 10.1 and drush 12.1 https://github.com/drush-ops/drush-launcher/issues/106 , this combination is not supported.
In another linked ticket Archive this project? https://github.com/drush-ops/drush-launcher/issues/105 for more detailed information, including possible solutions to the problem.
The solution is a new drush-launcher
The original PHP project existed under the user drush-ops https://github.com/drush-ops/drush-launcher. A new project of the same name - this time in go - was created by Tom Donahue (dasginganinja) https://github.com/dasginganinja/drush-launcher.
Installation is just as simple - just download the package for your operating system and architecture, unzip it, and rename the drush-launcher file and upload it here /usr/local/bin/drush, for example.
Now the drush status should already list the required information from the Drupal install.

Conclusion
A fairly simple triviality that has worked for years now needs a new approach. But the process is just as simple, you just need to know which drupal-launcher is the right one for drush 12 (needed for drupal 10).