Home » Magento, Magento 214 July 2016

Magento 2: [InvalidArgumentException] There are no commands defined in the “setup” namespace

I am getting the following error while adding a new module to my Magento 2 installation and running the command on terminal php bin/magento setup:upgrade.

[InvalidArgumentException] There are no commands defined in the “setup” namespace

The same kind of error will be displayed in terminal when I try to run other commands like php bin/magento module:status

[InvalidArgumentException] There are no commands defined in the “module” namespace

php bin/magento cache:clean

[InvalidArgumentException] There are no commands defined in the “cache” namespace

Solution 1:

The general main cause of this kind of error is missing etc/module.xml file in your module. Or, missing setup_version code in module.xml file.

Here is a sample module.xml file of a module named YourNamespace_YourModule.

app/code/YourNamespace/YourModule/etc/module.xml

If you are not sure which module is creating this problem, you can try removing each module and check to find the problematic module.

Solution 2:

If solution 1 doesn’t help then you can try this second solution.

Give full control (read/write/execute) to var and pub directory solved this issue for me.

You may also try running the following command:

Hope this helps.
Thanks.

Magento 2

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed

Comments are closed.