drupal-console icon indicating copy to clipboard operation
drupal-console copied to clipboard

Bad path to /vendor/drupal/console-core/services.yml after console update

Open ransomweaver opened this issue 10 years ago • 52 comments

I have DC globally installed with composer, was working fine before rc2. I've updated to rc4 and composer updated the project drupal console to rc4 as well, but still broken.

Project structure: composer_root - vendor - web

outside web, "drupal list" gets the outside-root directory available commands list. Inside, it throws this error: The file "composer_root/web//vendor/drupal/console-core/services.yml" does not exist. in Symfony\Component\Config\FileLocator->locate()

Of course, the correct path is composer_root/web/../vendor/drupal/console-core/services.yml

console seems to know that "web" is the drupal webroot, but how can I tell it that it needs to go up a level to find the vendor directory?

And what is calling for services.yml? I don't grep that in ~/.console

ransomweaver avatar Oct 06 '16 04:10 ransomweaver

+1 same here

finnef avatar Oct 06 '16 07:10 finnef

@ransomweaver @finnef Starting on RC releases, DrupalConsole should be installed per site to avoid any issues with components and to support different versions of Drupal.

jmolivas avatar Oct 06 '16 11:10 jmolivas

I tried calling the locally installed version using ../vendor/drupal/console/bin/drupal from the web dir, but the same result. (local version installed using composer)

finnef avatar Oct 06 '16 11:10 finnef

@finnef is you site based on DrupalComposer?

jmolivas avatar Oct 06 '16 11:10 jmolivas

@jmolivas Yes: https://github.com/drupal-composer/drupal-project

finnef avatar Oct 06 '16 11:10 finnef

@finnef Try this:

cd web/
../vendor/bin/drupal

drupal-composer-drupal-console

jmolivas avatar Oct 06 '16 11:10 jmolivas

@finnef which version of DrupalConsole you have installed on the site?

You can by use composer to find out

> composer show | grep drupal/console

drupal/console                        1.0.0-rc4 The Drupal Console is a CLI too...
drupal/console-core                   1.0.0-rc4 Drupal Console Core
drupal/console-en                     1.0.0-rc1 Drupal Console English Language

jmolivas avatar Oct 06 '16 11:10 jmolivas

@jmolivas I will try this when I'm back at my machine, but AFAIK vendor/bin/drupal is just an alias to vendor/drupal/console/bin/drupal...

finnef avatar Oct 06 '16 11:10 finnef

Just tried this using the same project repo as finnef, and still gives me InvalidArgumentException: The file "/Applications/MAMP/htdocs/ucytech/web//vendor/drupal/console-core/services.yml" does not exist. in Symfony\Component\Config\FileLocator->locate() (line 44 of /Applications/MAMP/htdocs/ucytech/vendor/symfony/config/FileLocator.php).

Lendude avatar Oct 06 '16 11:10 Lendude

@jmolivas I had a working install on 1.0.0-beta5, and this problem started when updating to 1.0.0-rc4, but this included some other updates, including drupal 8.2rc-x. Maybe I should try 8.2GM, should be out since yesterday :-)

finnef avatar Oct 06 '16 11:10 finnef

@jmolivas

composer show | grep drupal/console

drupal/console 1.0.0-rc4 The Drupal Console is a CLI tool to generate boilerplate code, interact and debug Drupal 8. drupal/console-core 1.0.0-rc4 Drupal Console Core drupal/console-en 1.0.0-rc1 Drupal Console English Language

Lendude avatar Oct 06 '16 11:10 Lendude

@Lendude are you executing DC like this https://github.com/hechoendrupal/DrupalConsole/issues/2770#issuecomment-251937199 ?

jmolivas avatar Oct 06 '16 11:10 jmolivas

@jmolivas yeah

If I do ./vendor/bin/drupal outside the web dir it gives me: Something goes wrong with your package. Try downloading again. Executing: composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader

Is that normal behaviour?

Lendude avatar Oct 06 '16 11:10 Lendude

@Lendude

If I do ./vendor/bin/drupal outside the web dir it gives me:

This means it works form the web directory?

jmolivas avatar Oct 06 '16 11:10 jmolivas

@jmolivas no, that still gives InvalidArgumentException: The file "/Applications/MAMP/htdocs/ucytech/web//vendor/drupal/console-core/services.yml" does not exist. in Symfony\Component\Config\FileLocator->locate() (line 44 of /Applications/MAMP/htdocs/ucytech/vendor/symfony/config/FileLocator.php).

Lendude avatar Oct 06 '16 11:10 Lendude

@jmolivas was just hoping that some extra info might give you a hint of where we can look :)

Lendude avatar Oct 06 '16 11:10 Lendude

@Lendude what I see is not building the path correctly This Applications/MAMP/htdocs/ucytech/web//vendor/drupal/console-core/services.yml Should be Applications/MAMP/htdocs/ucytech/vendor/drupal/console-core/services.yml

But no idea why

jmolivas avatar Oct 06 '16 11:10 jmolivas

@jmolivas Ok thanks for thinking along. Since @finnef and I both have the same problems inside the same project repo and this is not something that is happening for everybody using a DrupalComposer setup, I assume it's something in our settings/config that messing things up.

Will report back if we figure anything out!

Lendude avatar Oct 06 '16 12:10 Lendude

@finnef @Lendude did you try using the global executable launcher?

Install global executable launcher tool:

# Run this in your terminal to get the latest project version:
curl https://drupalconsole.com/installer -L -o drupal.phar

# Accessing from anywhere on your system:
mv drupal.phar /usr/local/bin/drupal

# Apply executable permissions on the downloaded file:
chmod +x /usr/local/bin/drupal

After this try drupal initand answer yes to the first question about copying at current directory

jmolivas avatar Oct 06 '16 12:10 jmolivas

@finnef @Lendude you can also log into the gitter channel https://gitter.im/hechoendrupal/DrupalConsole to ask questions and we can continue this via private messages on gitter.

jmolivas avatar Oct 06 '16 12:10 jmolivas