I have installed latest version of Megento 2, everything was worked fine. I have created one custom module. After activated my custom module, I got an error like "Setup version for module 'Chilly_Draji' is not specified".
When i enable my module in first time, I didn't write composer.json file. After creating composer.json file, I can't able to upgrade. when i run command "php bin/magento setup:upgrade", got an below error
[InvalidArgumentException]
There are no commands defined in the "setup" namespace.
After removed composer.json file,It's working fine..
when i install new magento 2 module which was created by module creator, I got an error like "Setup version for module 'Chilly_Test' is not specified" every time. Its happening only in apache server. That same module working fine in "Nginx" server
@DRAJI you need to also create a etc/module.xml with setup_version like this. Also, can you be more specific about which module creator you used?
I had a similar error message when creating a simple hello world module
My problem was in the module.xml file, in which the header line "" was not the first line in the file
FYI
Hi @DRAJI i close the issue because you didn't answered @mazhalai after 2 weeks. If you have still the error please feel free to reopen the issue.
Hi, Thanks for the reply. It was an ownership permission issue. After set ownership permission on specific plugin folder, It worked fine!
Thanks!
Hi,Could You Please tell me how to set ownership permission Because I am having similar issue.
Thanks.
Hi, If you have composer.json file, Plz check after remove it.
For ubuntu - chown -R :www-data .
still not working
[InvalidArgumentException]
There are no commands defined in the "setup" namespace.
its windows localhost
Giving full control (read/write/execute) to var and pub directory solved this issue for me.
sudo chmod -R 777 var pub
You may also try running the command using sudo.
sudo php bin/magento setup:upgrade
Thanks .mukesh..I will try this
On Jan 13, 2016 5:25 PM, "Mukesh Chapagain" [email protected]
wrote:
Giving full control (read/write/execute) to _var_ and _pub_ directory
solved this issue for me.sudo chmod -R 777 var pub
—
Reply to this email directly or view it on GitHub
https://github.com/magento/magento2/issues/2531#issuecomment-171266588.
no it didn't worked for me
Please avoid posting on closed issues, create a new one.
I had same error it was not making any sense then I found that my composer.json file of my module was not valid once I fixed and it worked ; hope it may help
@chapagain Sudo command worked for me.
I had the same issue and I followed several suggested suggestions to fix the problem like delete my composer.json something like that.
But those didn't fix my problem.
Today, I faced the problem again and I tried a new approach to trace the problem.
All details and screenshot are in my personal blog post
http://david.firstbiz.cc/blog_detail.php?id=115
I described my steps here:
1. for CLI, please append "-vvv" and it will display function trace paths 2. try to load any product page and check your web server error log and you will be able to see more details. 3. the class name and the filename should be same (*this is the case I faced)
it helped me to clear the following directories
var/di
var/cache
var/generation
var/page_cache
[InvalidArgumentException]
There are no commands defined in the "setup" namespace.
its windows localhost on wamp server
Running with sudo worked for me. or in root mode.
Most helpful comment
Giving full control (read/write/execute) to var and pub directory solved this issue for me.
You may also try running the command using sudo.