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>
1
  • Did you enabled it ( bin/magento module:enable Test_Banners ) ?
    – carco
    Apr 15, 2016 at 8:24

3 Answers 3

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

1
2

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

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

4
  • sorry typo mistake. still have fever of magento 1 :P Apr 15, 2016 at 5:33
  • Its working fine.Please check permission. Apr 15, 2016 at 5:41
  • which version you test it still not luck.. Apr 15, 2016 at 5:43
  • I have tested it in magento 2.0.0 Apr 15, 2016 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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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