There are no commands defined in the "setup" namespace : Magento 2

Deepak Mankotia picture Deepak Mankotia · Nov 26, 2015 · Viewed 18.4k times · Source

I have installed latest version of Megento 2, everything is working fine frontend, backend and functionality.

I have one issue with bin/magento setup:upgrade command, when I run this command in terminal I get below exception .

[InvalidArgumentException]
There are no commands defined in the "setup" namespace.

Screenshot :

enter image description here

Is there any thing I missed during installation or I need to install some package to let it working?

Answer

VIPIN A ROY picture VIPIN A ROY · Dec 1, 2015

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>

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

sudo chmod -R 777 var pub