I am facing below issue in my entire installations of M2.
[InvalidArgumentException]
There are no commands defined in the "setup" namespace.
weird thing is I installed fresh Xampp and set up new M2 instance, then also same issue persists. It started coming suddenly and I have tried all available solutions like setting permissions to folders and trying -vvv option and list command to find exact issue.
till now no success. My whole day wasted in debugging this only and now I am running out of thoughts.
If anyone have ideas?
I am using PHP 5.6 and Magento EE 2.1.7
2
Answers
Try Following Solution :
Solution 1 :Please mention setup_version in your module.xml file. Your module.xml file looks like:
Solution 2 : You need to give full permission to both var and pub folders recursively.
if above solution not work then try following link
https://magento.stackexchange.com/questions/103774/magento-2-there-are-no-commands-defined-in-the-setup-namespace-on-windows
The reason for this error can be seen in the command output:
php -f bin/magento
.This will work for most errors like
There are no commands defined in the "..." namespace.
.A fairly common cause is an error in
xml
files e.g.VendorName/ModuleName/etc/config.xml
.