I have a custom module
which is working perfectly in my local machine but while I am trying to enable my module in my magento 2
store hosted in cPanel
,
I am getting below error
> bbcmanagement@billionaireboysclub.com [~/public_html]# **php bin/magento module:enable -v BBC_ProductAdminAccess**
>ea-php-cli Copyright 2017 cPanel, Inc.
> [Zend_Json_Exception] Decoding failed: Syntax error
> Exception trace: () at /home/bbcmanagement/public_html/vendor/magento/zendframework1/library/Zend/Json.php:97 Zend_Json::decode() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/PackageInfo.php:85 Magento\Framework\Module\PackageInfo->load() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/PackageInfo.php:208 Magento\Framework\Module\PackageInfo->getRequire() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/DependencyChecker.php:132 Magento\Framework\Module\DependencyChecker->createGraph() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/DependencyChecker.php:95 Magento\Framework\Module\DependencyChecker->checkDependencyGraph() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/DependencyChecker.php:82 Magento\Framework\Module\DependencyChecker->checkDependenciesWhenEnableModules() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/Status.php:97 Magento\Framework\Module\Status->checkConstraints() at /home/bbcmanagement/public_html/setup/src/Magento/Setup/Console/Command/AbstractModuleManageCommand.php:92 Magento\Setup\Console\Command\AbstractModuleManageCommand->execute() at /home/bbcmanagement/public_html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257 Symfony\Component\Console\Command\Command->run() at /home/bbcmanagement/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:874 Symfony\Component\Console\Application->doRunCommand() at /home/bbcmanagement/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:195 Symfony\Component\Console\Application->doRun() at /home/bbcmanagement/public_html/vendor/magento/framework/Console/Cli.php:96 Magento\Framework\Console\Cli->doRun() at /home/bbcmanagement/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:126 Symfony\Component\Console\Application->run() at /home/bbcmanagement/public_html/bin/magento:23
>module:enable [-f|--force] [--all] [-c|--clear-static-content] [--magento-init-params="..."] [module1] ... [moduleN] }
app\code\BBC\ProductAdminAccess\composer.json
{"name": "bbc/sample-module-minimal",
"description": "A module that creates a page in the Magento admin area",
"type": "magento2-module",
"version": "1.0.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"php": "~5.6.0|7.0.2|7.0.4|~7.0.6"
},
"autoload": {
"files": [ "registration.php" ],
"psr-4": {
"BBC\\ProductAdminAccess\\": ""
}
}}
app\code\BBC\ProductAdminAccess\registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'BBC_ProductAdminAccess',
__DIR__);
I have checked the format of the json file using online format checker and it came out fine.
Please help Me with it.
Best Answer
I just tried the below code and it worked fine.