I have been trying to set up Drupal Console for quite some time now on Windows 7; however, there always seems to be some kind of error which I am unable to solve.

I have installed Drupal Console via the drupal.phar way which I placed in a directory that is included in the PATH variable and it gets called properly. However, every time I call the console from the command line it gives me the following notice:

Notice: Undefined index: commands in phar://C:/_Skripty/drupal/vendor/drupal/console-core/src/Utils/ConfigurationManager.php on line 273

The second weird thing is that I want to use it in multiple project and it does actually seem to be working, in a way, in one of the projects but not in the other. For example, I am able to get the list of available commands in one, but running that same command in the other produces the following fatal error in addition to the above mentioned notice.

Fatal error: Trait 'Drupal\Console\Command\Shared\ModuleTrait' not found in C:\xampp\htdocs\sam_stroje\modules\metatag\src\Command\GenerateGroupCommand.php on line 32

I suspect that this might be caused by some modules not correctly implementing the stuff that has to do something with the console but I'm not 100% sure.

What might be the cause of these problems? Thanks in advance for all replies.

3 Answers 3


This will surely help you debug: https://evolvingweb.ca/drupal-console-windows-devdesktop-troubleshooting

And here is a guide explaining how to do it from scratch: https://evolvingweb.ca/blog/installing-drupal-console-windows


I would add this as a comment, but I am missing points.

I have the same first issue that you mention on my installation on Mac OSX El Capitan, so this is not Windows related.

I found that this issue has already been reported and shall be fixed in the next release candidate (RC 10).

A temporary fix is to run drupal init.

Reference to the issue queue

As for your second issue, this has also been reported and not fixed yet, maybe you can provide them with some information about your case, as the issue is in "Maintainer needs more information" status. See here.

  • It is worth to be an answer.
    – Jimmy Ko
    Nov 24, 2016 at 12:30

3 steps to install composer on windows machines

  • Run composer require drupal/console in your Drupal installation directory
  • Add this ;vendor\bin\drupal; to path in your environment variable
  • Run drupal console commands to verify and enjoy.

To add a path in env-variable

Right click on computer properties

click advanced settings

click Environment Variables

edit PATH from system variables list

Add this ;vendor\bin\drupal; and save

Restart command prompt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.