Drupal 8 console error: Command is not a valid command name [SOLVED].

This error shows up when trying to generate a controller, module, form or whatever. The issue is, that console needs a uri to work with. Change your command from

drupal generate:controller

to

drupal generate:controller --uri=mysite.local

 

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!