cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to enable custom module

SOLVED

Unable to enable custom module

Hi, 

 

I am trying to create my first Magento 2.1 module by following this tutorial.

The module can be seen by executing:

php bin/magento module:status

An attempt to enable the module fails with the following error:

 

php bin/magento module:enable Excellence_Custom

[Magento\Framework\Exception\FileSystemException] 
The file "/composer.json" doesn't exist   

 

Also, if this has anything to do with the aforementioned problem, I get another one:

 

php bin/magento setup:upgrade

 [Exception]                                                                                             
  Warning: file_get_contents(/usr/local/var/www/htdocs/magento2/var/di/setup.ser): failed to open stream  
  : No such file or directory in /usr/local/var/www/htdocs/magento2/vendor/magento/framework/App/ObjectM  
  anager/ConfigLoader/Compiled.php on line 28  

Any hints or clues would be appreciated!

 

Thanks,

Gin

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Unable to enable custom module

Hi @ginsul

 

Sorry, I did not notice the Magento version 2.1 mentioned in your initial post.

 

There seems to be a bug in Magento 2. Please keep following Magento 2.1 RC1 - Error when running CLI upgrade command url for any updates.

 

As per comments on this issue by Magento team, soon a patch or upgrade version will be released to fix this issue.

 

 

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

View solution in original post

5 REPLIES 5

Re: Unable to enable custom module

Hi @ginsul

 

Can you share the code which is in your module.xml file?

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Unable to enable custom module

Helo @Mukesh Tiwari,

 

Thanks for the response!

Of course, please find the source code below:

 

./magento2/app/code/Excellence/Custom/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Excellence_Custom" setup_version="0.0.1"/>
</config>

 

./magento2/app/code/Excellence/Custom/registration.php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
        \Magento\Framework\Component\ComponentRegistrar::MODULE
        , "Excellence_Custom", __DIR__
);

 

Thanks,

Gin

Re: Unable to enable custom module

Hi @ginsul

 

Sorry, I did not notice the Magento version 2.1 mentioned in your initial post.

 

There seems to be a bug in Magento 2. Please keep following Magento 2.1 RC1 - Error when running CLI upgrade command url for any updates.

 

As per comments on this issue by Magento team, soon a patch or upgrade version will be released to fix this issue.

 

 

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Unable to enable custom module

Thanks @Mukesh Tiwari!

Re: Unable to enable custom module

On my side, the module have been enabled with the `--force` option

php bin/magento module:enable Module_Name -f