Magento 2 Setup version for module is not specified. How to fix?

1

Have you upgrade your Magento to Magento 2 (ver. 2.0.0) yet? If yes, do you have any troubles with your registered module which is used to work fine before stable release? Unless your module is lucky enough to run well, there are several modules are generated by Mangento 2 with the not- specified error. It seems to be that Magento 2 API is fast changing without a backward compatibility so the Magento 2 extensions may not work well. Consequently, it is required that developers update their module(s) frequently.

Related tutorial: Fixing Magento exception printing is disabled by default for security reasons

In this tutorial, we will learn how to fix error: Magento 2 Setup version for module is not specified, a common error you will encounter when upgrading Magento version or creating new Magento 2 module, or after removing a Magento 2 module.

magento 2 setup version for module is not specified

Change module file/folder permission

Wrong file/folder permission may cause this error, you should try to set proper permission first, run this command in Magento 2 CLI

for example:

Remove module from app/etc/config.php

If you see the error after removing a module of Magento, then try to remove the module in config.php file located in app/etc/config.php, for example:

Remove the unwanted module (for example:  Magento_custommodule  ) and save the file. Finally clear cache to see if the error is gone.

Adding registration.php and composer.json

You may encounter this issue when creating a new Magento 2 Module. Assume that you have your module registered in  app/etc/config.xml  like this:

The module

file under app/code/Namespace/Modulename/etc/module.xml:

When you run the module, Magento 2 generates the error below:

Now here is how to fix it.

First, try to declare the module in module. xml:

Next, add registration.php  and composer.json  in your module.

/app/code/Namespace/Module/registration.php

/app/code/Namespace/Module/composer.json

After that, you run

and schema upgrade if applicable by running the command:

Now, you have to clear all caches and var/generation folder.

Login to the back end of Magento 2. On the Admin side bar, navigate to Stores >Configurations > Advanced > Advanced.

Your new module should be listed here and start running without the not- specify error anymore.

Good luck!

Magento 2 Setup version for module is not specified. How to fix?
3.06 (61.15%) 52 votes

Share.

About Author

Daniel is a Magento developer with 5 years of experience with customizing Magento extensions, Magento templates. He's main author at Magento explorer

1 Comment

Leave A Reply