skip to Main Content

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


  1. Try Following Solution :

    Solution 1 :Please mention setup_version in your module.xml file. Your module.xml file looks like:

     <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
      <module name="Vendor_Module" setup_version="1.0.0"/> 
    </config>
    

    Solution 2 : You need to give full permission to both var and pub folders recursively.

    sudo chmod -R 777 var pub
    

    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

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search