Magento 2 Error/Bug:

Platform: Windows 10 – Xampp

Capture

e:\xampp\php>php.exe  E:\xampp\htdocs\m2\bin\magento cron:run

[InvalidArgumentException]

There are no commands defined in the “cron” namespace.

 

e:\xampp\php>php.exe  E:\xampp\htdocs\m2\bin\magento setup:upgrade

[InvalidArgumentException]

There are no commands defined in the “setup” namespace.

 

e:\xampp\php>php.exe  E:\xampp\htdocs\m2\bin\magento deploy:mode:set developer

[InvalidArgumentException]

There are no commands defined in the “deploy:mode” namespace.

 

Run Following steps to check & then try again:

  1. Run “composer install” in magento root.
  2. please use the -v or -vv option in the command line for debug information.
  3. If an extension has no etc/module.xml file then bin/magento fails.
  4. If a composer.json has a syntax error.

In my case, the problem solved while i removed my custom module which was in app/code/<vendorName>/<moduleName>. maybe there was some problem with module’s “composer.jason” or “module.xml” file.