Bad path to /vendor/drupal/console-core/services.yml after console update
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
+1 same here
@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.
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 is you site based on DrupalComposer?
@jmolivas Yes: https://github.com/drupal-composer/drupal-project
@finnef Try this:
cd web/
../vendor/bin/drupal

@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 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...
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).
@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 :-)
@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 are you executing DC like this https://github.com/hechoendrupal/DrupalConsole/issues/2770#issuecomment-251937199 ?
@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
If I do ./vendor/bin/drupal outside the web dir it gives me:
This means it works form the web directory?
@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).
@jmolivas was just hoping that some extra info might give you a hint of where we can look :)
@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 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!
@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
@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.