I installed Drupal 8 into on my localhost, working under Windows 7 with OpenServer.
After it I tried to install Drupal Console using Composer.
Namely, this way
composer global require drupal/console:@stable
It installed without errors.
But when I'm trying to execute Drupal Console (with command "drupal"), there is an error on the console:
Fatal error: Class 'Drupal\Console\Bootstrap\Drupal' not found in D:\OpenServer\domains\palomniki.local\vendor\drupal\console\bin\drupal.php on line 50
Could you clarify me, how to solve this problem ?
@roman-yakimkin DrupalConsole must be installed per site. Install Drupal Console using composer global require is not supported.
More info at: https://docs.drupalconsole.com/en/getting/project.html
Closing this one. Feel free to re-open if still happening after updating to the latest version.
Hello.
Sorry for troubling but I had to reopen this issue.
The reason of it in an error displaying when I'm trying to run the console.
TypeError: Argument 2 passed to Drupal\Console\Command\Config\ExportCommand::__construct() must implement interface Drupal\Core\Config\StorageInterface, none given in Drupal\Console\Command\Config\ExportCommand->__construct() (line 43 of D:\OpenServer\domains\mysite.local\vendor\drupal\console\src\Command\Config\ExportCommand.php).
It happened after I had updated Drupal from 8.3.0 to 8.3.1. Before it I deleted the vendor folder from the site and after it I reinstalled locally and updated the Drupal Console.
Could you clarify me, what did I do wrong and how to repair it ?
@roman-yakimkin which version of DrupalConsole are you using ? A re you using the Launcher aka global executable?
I don't know, which version I'm using.
Several times I press this command :
drupal self-update
and each time I see the following:
Checking for updates from version: "1.0.0-rc16-2-g56546c5"
Updated from version "1.0.0-rc16-2-g56546c5" to version "1.0.0-rc17".
Size of the drupal.phar file is 157600 bytes.
Moreover, now the drupal command isn't executed correctly, but it writes
Could not find Drupal in the current path
If i'm not mistaken, iy hasn't happened before.
@roman-yakimkin exactly that di not happened before, we are moving to a per-site installation, you must run this within a Drupal site I mean cd /path/to/drupal and the execute drupal from there or use drupal --root=/path/to/site
@roman-yakimkin does clearing the caches help?
I too was seeing the error about ExportCommand after updating to 1.0.0-rc-17 and I bisected it and found that it started from commit https://github.com/hechoendrupal/drupal-console/commit/580b60fdd2b72d2ab15d203c0d0cecda31530c7e i.e. when a new service gets used by a class.
However, after rebuilding the caches with ./vendor/bin/drupal cache:rebuild all the error is gone and I can use 1.0.0-rc-17 just fine.
@jmolivas can you explain what is going on under the hood?
Thanks, Antonio
On an old project, I updated the Drupal console following the documentation using composer inside my project and got the same error.
Thanks to @ao2, the cache:rebuild all allowed me to use the console again
./vendor/bin/drupal cache:rebuild all
@ao2 DrupalConsole is caching commands that is why you need to execute cr command to rebuild cache with the new version of the commands included on the update.
@jmolivas thanks for the explanation.
Most helpful comment
@roman-yakimkin does clearing the caches help?
I too was seeing the error about
ExportCommandafter updating to 1.0.0-rc-17 and I bisected it and found that it started from commit https://github.com/hechoendrupal/drupal-console/commit/580b60fdd2b72d2ab15d203c0d0cecda31530c7e i.e. when a new service gets used by a class.However, after rebuilding the caches with
./vendor/bin/drupal cache:rebuild allthe error is gone and I can use 1.0.0-rc-17 just fine.@jmolivas can you explain what is going on under the hood?
Thanks, Antonio