0

I'm trying to install drupal console with Drupal 9.0.5, so I ran this command:

composer require drupal/console:~1.0

However when I try run the drupal command with any arguments I get this error:

root@6dc17ce2d4bf:/opt/drupal# drupal --version
TypeError: Argument 2 passed to Drupal\Console\Command\Test\RunCommand::__construct() must be an instance of Drupal\simpletest\TestDiscovery, null given in /opt/drupal/vendor/drupal/console/src/Command/Test/RunCommand.php on line 58 #0 [internal function]: Drupal\Console\Command\Test\RunCommand->__construct('/opt/drupal/web', NULL, Object(Drupal\Core\Extension\ModuleHandler), Object(Drupal\Core\Datetime\DateFormatter))
#1 /opt/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php(1144): ReflectionClass->newInstanceArgs(Array)
#2 /opt/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php(618): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), Array, true, 'console.test_ru...')
#3 /opt/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php(558): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('console.test_ru...', 1)
#4 /opt/drupal/vendor/drupal/console-core/src/Application.php(468): Symfony\Component\DependencyInjection\ContainerBuilder->get('console.test_ru...')
#5 /opt/drupal/vendor/drupal/console-core/src/Application.php(214): Drupal\Console\Core\Application->registerCommands()
#6 /opt/drupal/vendor/drupal/console-core/src/Application.php(119): Drupal\Console\Core\Application->loadCommands()
#7 /opt/drupal/vendor/drupal/console/src/Application.php(64): Drupal\Console\Core\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /opt/drupal/vendor/symfony/console/Application.php(147): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /opt/drupal/vendor/drupal/console/bin/drupal.php(89): Symfony\Component\Console\Application->run()
#10 /opt/drupal/vendor/drupal/console/bin/drupal(4): require('/opt/drupal/ven...')
#11 {main}
TypeError: Argument 2 passed to Drupal\Console\Command\Test\RunCommand::__construct() must be an instance of Drupal\simpletest\TestDiscovery, null given in Drupal\Console\Command\Test\RunCommand->__construct() (line 58 of /opt/drupal/vendor/drupal/console/src/Command/Test/RunCommand.php).

I don't really understand this error. Any ideas what might cause this?

3
  • Drupal Console has not been updated to run on new Drupal versions. It's even less compatible with Drupal 9, as many classes or methods have been removed.
    – apaderno
    Sep 12, 2020 at 8:29
  • Thanks, I'll have to make do without it then :)
    – quant
    Sep 12, 2020 at 15:10

1 Answer 1

1

This is really just kiamlaluno's answer, but they never posted it so I'll just copy it here verbatim:

Drupal Console has not been updated to run on new Drupal versions. It's even less compatible with Drupal 9, as many classes or methods have been removed.

Your Answer

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

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