Drupal-console: Command "generate:module", is not a valid command name.

Created on 1 Mar 2018  路  4Comments  路  Source: hechoendrupal/drupal-console

drupal generate:module will generate an error
macOS
php -v 7.1
drupal -v 8.5.0 rc1

drupal console seems to be installed

composer show | grep drupal/console
drupal/console                        1.6.1              The Drupal CLI. A tool to generate boilerplate code, interact w...
drupal/console-core                   1.6.1              Drupal Console Core
drupal/console-en                     1.6.1              Drupal Console English Language
drupal/console-extend-plugin          0.9.2              Drupal Console Extend Plugin

installed drupal console using

composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader 

drupal command returns

[ERROR] SQLSTATE[HY000] [2002] No such file or directory    

Most helpful comment

fixed it

export PATH="/Applications/MAMP/Library/bin:$PATH"
export PATH="/Applications/MAMP/bin/php/php7.1.12/bin:$PATH"

All 4 comments

@broros Is your site installed?
Can you check and confirm if any of the errors and fixes solve your issue => https://docs.drupalconsole.com/en/drupal_console_faq/installation-problems.html

fixed it

export PATH="/Applications/MAMP/Library/bin:$PATH"
export PATH="/Applications/MAMP/bin/php/php7.1.12/bin:$PATH"

Closing this one. Feel free to re-open if still happening after updating to the latest version.

@broros thanks for letting us know

Was this page helpful?
0 / 5 - 0 ratings