1.If module.xml is missing in the any third party extension , Magento CLI fails and don't throw the exact error . And there is no way to debugg the real cause of error.
I have checked this in Magento version 2.3 vanilla .
Steps to reproduce (*)
Create a new test module.
Define registration.php and composer.json in it.
Run any CLI command ( setup:upgrade or setup:di:compile ) etc .
Expected result (*)
It should throw the exact exception that module.xml is not defined in this third-party extension.
Or it should throw the exception but CLI commands run properly.
Actual result (*)
/opt/lampp/htdocs/magento/2.3 $ sudo /opt/lampp/bin/php bin/magento setup:di:compile
There are no commands defined in the "setup:di" namespace.
If you are using any third party extensions then its very difficult to find what is the actually error and due to a third party xml file , i don't think whole magneto CLI need to be stopped.
Preconditions --
1.If module.xml is missing in the any third party extension , Magento CLI fails and don't throw the exact error . And there is no way to debugg the real cause of error.
Steps to reproduce (*) Create a new test module. Define registration.php and composer.json in it. Run any CLI command ( setup:upgrade or setup:di:compile ) etc .
Expected result (*) It should throw the exact exception that module.xml is not defined in this third-party extension.
Or it should throw the exception but CLI commands run properly.
Actual result (*)
/opt/lampp/htdocs/magento/2.3 $ sudo /opt/lampp/bin/php bin/magento setup:di:compile There are no commands defined in the "setup:di" namespace.