I created a module.xml under the app/code/my/module/etc folder.
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="my_module" setup_version="1.0.0" />
</config>
Than I tried to enable the module with following command
php -f bin/magento module:enable --clear-static-content my_module
And get this error:
Unknown module(s): 'my_module'
Why don't Magento find the module?
Here is the error after executing the flush command:
[InvalidArgumentException]
There are no commands defined in the "cache" namespace.
Now here is the error:
Additionally to the xml syntax in the module.xml I added comments. These comments caused the error.