2

after php bin/magento setup:upgrade module is not listed. where is my mistake?

File location are

app/code/Test/composer.json

{
    "name": "test/banners",
    "description": "Test Banner For test",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Test\\Banners\\": ""
        }
    }
}

app/code/Test/registration.php

  <?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Test_Banners',
    __DIR__
);

app/code/Test/Banners/etc/module.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Test_Banners" setup_version="2.0.0">

    </module>
</config>
  • Did you enabled it ( bin/magento module:enable Test_Banners ) ? – carco Apr 15 '16 at 8:24
5

In your edit I see that you're listing files (registration.php and composer.json) outside the module's directory. The correct path for these file should be:

app/code/Test/Banners/registration.php

app/code/Test/Banners/composer.json

app/code/Test/Banners/etc/module.xml

after making these changes run the php bin/magento setup:upgrade command

| improve this answer | |
2

Its not app/code/Test/Banners/etc/config.xml

It is app/code/Test/Banners/etc/module.xml

| improve this answer | |
  • sorry typo mistake. still have fever of magento 1 :P – Qaisar Satti Apr 15 '16 at 5:33
  • Its working fine.Please check permission. – Prashant Valanda Apr 15 '16 at 5:41
  • which version you test it still not luck.. – Qaisar Satti Apr 15 '16 at 5:43
  • I have tested it in magento 2.0.0 – Prashant Valanda Apr 15 '16 at 5:44
2

plz replace below code to your composer.json file,

{
    "name": "test/magento2-banners",
    "description": "Test Banner For test",
    "require": {
        "php": "~5.5.0|~5.6.0"
    },
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
 "extra": {
        "map": [
            [
                "*",
                "Test/Banners"
            ]
        ]
    }
}

Remove var folder and type setup command, Its working fine.

| improve this answer | |
  • after change still not working – Qaisar Satti Apr 15 '16 at 5:59
  • still same not working – Qaisar Satti Apr 15 '16 at 6:14
  • which error are display in cmd? – Rakesh Jesadiya Apr 15 '16 at 6:16
  • no error in command – Qaisar Satti Apr 15 '16 at 6:16
  • you have to check for app/etc/config.php file, for Test_Banners => 1 entry or not? – Rakesh Jesadiya Apr 15 '16 at 6:18

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.