0

Apols, first time posting, not sure of protocol. I have similar problem to Package "drupal/core" is not installed Trying to install Drush. WAMP, PHP8, Windows 11

I have PATH to..\htdocs\drupal_test3\vendor\drush\drush in User variables in Environment variables I have installed composer in ../htdocs/drupal_test3

./htdocs/drupal_test3
composer --version
Composer version 2.5.8 2023-06-09 17:13:21*

I cd to ../htdocs/drupal_test3/vendor/drush/drush Type drush. I get

../htdocs/drupal_test3/vendor/drush/drush
$ drush --version
 [preflight] Package "drupal/core" is not installed

Help appreciated.

  • WAMP is yesteryear's technology. Use DDEV or Lando. Nevertheless, what happens when you `cd ../htdocs/drupal_test3 && ./vendor/drush/drush/drush --version`? – leymannx Jul 04 '23 at 15:32
  • I think it should be 3 times `drush/`. Can also help you post your composer.json. – leymannx Jul 04 '23 at 15:33
  • That is what I tried - cd to drush/drush and then drush --version. Tried your syntax, same result. composer.json shows: { "require": { "drush/drush": "^12.1" } } – David Mathew Jul 04 '23 at 16:39
  • 1
    Spent a couple of days on this, to no avail, so I started over completely from scratch, installed Lando and worked forward from there. That worked for me. – David Mathew Jul 22 '23 at 15:48

1 Answers1

0
  1. composer remove drush/drush
  2. composer require drush/drush:^11

The above steps working fine for me

GGSankar
  • 29
  • 8
  • Still the same error message for me, I'm afraid. composer.json now shows { "require": { "drush/drush": "^11" } } – David Mathew Jul 05 '23 at 11:25
  • Have you installed drush globally ? ./vendor/bin/drush working for you could you please check it. – GGSankar Jul 05 '23 at 12:23
  • At the windows cmd prompt: .\vendor\drush\drush>drush --version gives the error: PHP Fatal error: Uncaught Symfony\Component\Filesystem\Exception\RuntimeException: Cannot find the home directory path: Your environment or operating system isn't supported. in .\vendor\symfony\filesystem\Path.php:204 Stack trace: #0 .\vendor\drush\drush\drush.php(69): Symfony\Component\Filesystem\Path::getHomeDirectory() #1 .\vendor\drush\drush\drush(4): require('C:\\Server\\data\\...') #2 {main} thrown in .vendor\symfony\filesystem\Path.php on line 204 Same error wherever I do drush --version from – David Mathew Jul 05 '23 at 17:20
  • Drush is currently installed locally to the Drupal project. Has been installed globally previously, but I have removed it. Using git bash I get the '[preflight] Package "drupal/core" is not installed' wherever I do drush --version from. Thanks for your help btw – David Mathew Jul 05 '23 at 17:22
  • From Windows cmd: ./vendor/bin/drush --version **not** ./vendor/drush/drush. If you installed Drush globally, you need to configure in the system environmental variables. – GGSankar Jul 06 '23 at 05:08
  • Path to the htdocs folder\vendor\bin folder is in the environmental system variables Run c:\..\..\htdocs\d10test\vendor\bin>drush --version I get Fatal error: Uncaught Symfony\Component\Filesystem\Exception\RuntimeException: Cannot find the home directory path: Your environment or operating system isn't supported. in C:\Users\user1\AppData\Roaming\Composer\vendor\symfony\filesystem\Path.php:204 – David Mathew Jul 06 '23 at 14:43