There are no commands in the setup namespace: Magento 2

I installed the latest version of Megento 2 , everything works fine, interface and functionality.

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

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

Screenshot:

enter image description here

Is there something I missed during the installation, or do I need to install some kind of package for it to work?

+5
source share
3 answers

Please specify setup_version in the module.xml file. Your module.xml file looks like this:

 <?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 provide full resolution for var and pub recursions.

 sudo chmod -R 777 var pub 
+11
source

Providing full control (read / write / execute) to the var and pub directory should solve this problem.

 sudo chmod -R 777 var pub 

You can also try running the command using sudo .

 sudo php bin/magento setup:upgrade 
+2
source

I wanted to add an answer because others do not cover all the problems that might cause this error:

There are no commands in the setup namespace.

generally.

This error may be caused by permission, as said in other answers, but we may have a different scenario.

  • Missing: etc / module.xml
  • Error in /etc/module.xml or in /etc/di.xml or other xml extensions under / etc

If you know another scenario, comment on this answer.
Hope this help.

+1
source

Source: https://habr.com/ru/post/1236891/


All Articles