I made my own Magento 2 module for adding a custom field to an existing table sales_order_item. When I try to enable the module with the command

php bin/magento module:enable Test_ProductType

The following error occurred,

There are no commands defined in the "module" namespace

And if I ran this command

php bin/magento

I got this output, see image:

enter image description here

And this is my 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="Test_ProductType" setup_version="2.0.5">
    <module name="Test_ProductType"/></sequence>

What do I have to do to make this module working?

  • 1
    most probably you have listed your module as a dependency for your module. Or one class from your module has as a dependency the same class – Marius Feb 22 '17 at 13:37
  • Can you post your module xml? – Khoa TruongDinh Feb 22 '17 at 13:37
  • I just edited my post with module.xml included – Magento Learner Feb 22 '17 at 13:45

Take care when using sequence in multiple components because it's possible to define circular dependencies. If you do, Magento aborts the installation when it detects the circular dependency.

This is because your module declares itself as a dependency. So, should remove the sequence node. Your module.xml should be:

<?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="Scandesigns_ProductType" setup_version="2.0.5"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.