drush icon indicating copy to clipboard operation
drush copied to clipboard

Problem with latest version of composer 2.7.1

Open Uccio opened this issue 1 year ago • 2 comments

Bug description Drush does not detect the site installed but only if installed with composer >2.7.1 with composer 2.6.6 all is ok! On the system globally there is drush installed and the drupal project explicitly contains a drush updated to the latest version The error is: [preflight] The alias references a Drupal site that does not contain its own copy of Drush. Please add Drush to this site to use it.

To Reproduce as root php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php && php -r "unlink('composer-setup.php');" mv /var/www/composer.phar /usr/local/bin/composer

as user: go to your drupal project
composer install and try to use drush

Workaround downgrade composer to 2.6.6 with: composer self-update 2.6.6

System Configuration

Q A
Drush version? 12.4.2.0
Drupal version? 10.1.8
PHP version 8.1.27
OS debian (php:8.1-fpm-bullseye)
Composer 2.7.1

Additional information I can't identify if the problem is directly composer or drush but with the new composer magically all my pipelines broke.

Uccio avatar Feb 14 '24 09:02 Uccio

Does vendor/bin/drush exist in sites that are exhibiting the symptom?

greg-1-anderson avatar Feb 16 '24 15:02 greg-1-anderson

Yes,

this is the content of ./vendor/bin

1945143 4.0K drwxr-xr-x 2 root root 4.0K Feb 20 11:36 . 1945133 4.0K drwxr-xr-x 33 root root 4.0K Feb 20 11:36 .. 1945144 4.0K -rwxr-xr-x 1 root root 3.3K Feb 13 08:41 dcg 1945145 4.0K -rwxr-xr-x 1 root root 3.3K Feb 13 08:41 drush 1945146 4.0K -rwxr-xr-x 1 root root 3.4K Feb 13 08:41 patch-type-declarations 1945147 4.0K -rwxr-xr-x 1 root root 3.3K Feb 13 08:41 php-parse 1945148 4.0K -rwxr-xr-x 1 root root 3.3K Feb 13 08:41 psysh 1945149 4.0K -rwxr-xr-x 1 root root 3.4K Feb 13 08:41 release 1945150 4.0K -rwxr-xr-x 1 root root 3.3K Feb 13 08:41 robo 1945151 4.0K -rwxr-xr-x 1 root root 3.4K Feb 13 08:41 var-dump-server 1945152 4.0K -rwxr-xr-x 1 root root 3.3K Feb 13 08:41 yaml-cli 1945153 4.0K -rwxr-xr-x 1 root root 3.3K Feb 13 08:41 yaml-lint

Uccio avatar Feb 20 '24 13:02 Uccio

Global drush is no longer supported. Please call vendor/bin/drush directly.

weitzman avatar Feb 23 '24 03:02 weitzman