I have installed the latest version of Magento 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:
Is there anything I missed during installation or I need to install some package to let it work?
Best Answer
In my case, it worked using sudo
sudo bin/magento setup:upgrade
EDIT 19/02/16
Actually, the "sudo" solution is more a workaround for bad permissions/ownership of Magento files.
If you don't already have a Magento file system owner, create one and add it to the apache group.
Now that you have your user, you can set the ownership and permissions (with root or an user with sudo)
Switch to the magento user
Now you should be able to run php bin/magento setup:upgrade or any other command with your magento user