Magento 2 CLI – No Commands Issue

climagento2

I installed a local Magento environment on XAMPP using composer. The database is also running on XAMPP (MySql). After the (web) setup i found out that the static files where not generated yet so I tried to run following command:

php bin/magento setup:static-content:deploy -f

I got the "There are no commands defined in the "setup" namespace." error. After that I tried running cache:clear but I got the same error.

When I run

php bin/magento

I got 3 error message along with some normal info. The error message are the following:

[Zend\ServiceManager\Exception\ServiceNotCreatedException] An abstract factory could not create an instance of magentosetupconsolecommandconfigsetcommand(alias: Magento\Setup\Console\Command\ConfigSetCommand).

[Zend\ServiceManager\Exception\ServiceNotCreatedException] An exception was raised while creating "Magento\Setup\Console\Command\ConfigSetCommand"; no instance returned 

[Magento\Framework\Exception\FileSystemException] Cannot read contents from file "C:\xampp\htdocs\magitas\app\code\duo\main\etc\module.xml" Warning!file_get_contents(C:\xampp\htdocs\magitas\app\code\duo\main\etc\module.xml): failed to open stream: No such file or directory

I have the correct user rights (otherwise my setup would not have run).

Thanks

Best Answer

Found the solution, and I'm a little embarrassed to be honest. It was because the module.xml file was not created in one of my custom modules