Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

drush-laucher 0.10.2 not working with drupal 10.1 and drush 12.1 #106

Open
NgatiaFrankline opened this issue Jul 2, 2023 · 7 comments
Open

Comments

@NgatiaFrankline
Copy link

When i run ./vendor/bin/drush works fine.With drush launcher i get Please add Drush with Composer to your project message. Here is my debug output:

@>drush --debug
Drush Launcher Version: 0.10.2
ROOT: /var/www/drupal
DRUSH VERSION: 
DRUPAL ROOT: /var/www/drupal/web
COMPOSER ROOT: /var/www/drupal
VENDOR ROOT: /var/www/drupal/vendor
The Drush launcher could not find a local Drush on your Drupal site.
Please add Drush with Composer to your project.
Run 'cd "/var/www/drupal" && composer require drush/drush'

When i run drush:

@>drush cr
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/drupal" && composer require drush/drush'

My Drupal installation folder /var/www/drupal
My installer path from the drupal-recommend project:

            "web/core": [
                "type:drupal-core"
            ],

However, when I downgrade to composer require drush/drush:11.5 works fine.
My debug output:

@>drush --debug
Drush Launcher Version: 0.10.2
ROOT: /var/www/drupal
DRUSH VERSION: 11
DRUPAL ROOT: /var/www/drupal/web
COMPOSER ROOT: /var/www/drupal
VENDOR ROOT: /var/www/drupal/vendor
 [preflight] Config paths: /var/www/drupal/vendor/drush/drush/drush.yml
 [preflight] Alias paths: /var/www/drupal/web/drush/sites,/var/www/drupal/drush/sites
 [preflight] Commandfile search paths: /var/www/drupal/vendor/drush/drush/src
 [info] Starting bootstrap to max [0.19 sec, 3.05 MB]
 [debug] Trying to bootstrap as far as we can [0.19 sec, 3.05 MB]
....

Don't see any error in my console. I tried even the fallback option did not work.

@stefan-korn
Copy link

see #105 about this. seems drush 12 is not supported by drush launcher by now and maybe never will. drush encourages to not use drush launcher anymore. use vendor/bin/drush and maybe add vendor/bin to your PATH to use without path as with the launcher (for multiple environments you can maybe use direnv for that

@alxvallejo
Copy link

@stefan-korn How does one 'not use drush launcher'?

@stefan-korn
Copy link

you can use vendor/bin/drush from your project and maybe add that to your PATH to still be able to just use "drush" as command. the drush launcher is a helper that let you use "drush" for all of your projects without adding to PATH, but drush launcher is not supported for drush 12 aynmore.

@alxvallejo
Copy link

@stefan-korn Well what if you have two separate drupal projects each with their own drush? You'd have to manually change your PATH settings each time you want to switch projects? Where's the sense in that?

@stefan-korn
Copy link

I was not involved in deciding of drush 12 to not support drush launcher anymore, but as far as I understand there were valid (technical) reasons for that (see #105 for details)

Consider using direnv for multi project setup like described at https://github.com/drush-ops/drush-launcher#alternatives

Surely it maybe a bit annoying if you used drush launcher for long time to switch to something different, but that's the way it is I suppose. You can also check the drush issue queue, for example drush-ops/drush#5694. There some alternatives have been discussed that may or may not work depending on your environment.

@weitzman
Copy link
Member

FYI, its the other way around. Launcher is not supporting Drush12/Composer yet.

@leymannx
Copy link

@alxvallejo – Find some easy alias/function replacements for a global drush command in this issue: #105

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants