0

I reviewed the suggestion here How to Create Extension Package in Magento 2? but I am still getting issue:- The "composer.json" file has incorrect JSON; please verify the archive. my composer.json is as below

{
  "name": "Vendorname/Modulename",
  "description": "Magento 2 Qrcode Generator",
  "require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
  },
  "type": "magento2-module",
  "version": "1.0.1",
  "license": [
    "OSL-3.0",
  ],
  "authors": [
    {
      "name": "w3solver",
      "email": "query@w3solver.com",
      "homepage": "https://www.w3solver.com",
      "role": "developer"
    }
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Vendorname\\Modulename\\": ""
    }
  }
}

I zipped my folder by name vendorname_modulename-1.0.1, my version is 1.0.1 in module.xml. I created zipped from 'modulename'

I am not getting what is wrong with my composer.json

0

Try this one. You added "," after last value, for example :

"require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
  },

it should be :

"require": {
    "php": "~5.5.0|~5.6.0|~7.0.0"
  },

++++++++++++++++++++++++++++++++++++++++++++++++++++++

{
  "name": "Vendorname/Modulename",
  "description": "Magento 2 Qrcode Generator",
  "require": {
    "php": "~5.5.0|~5.6.0|~7.0.0"
  },
  "type": "magento2-module",
  "version": "1.0.1",
  "license": [
    "OSL-3.0",
    "proprietary"
  ],
  "authors": [
    {
      "name": "w3solver",
      "email": "query@w3solver.com",
      "homepage": "https://www.w3solver.com",
      "role": "developer"
    }
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Vendorname\\Modulename\\": ""
    }
  }
}
0

I am not sure what was exactly the issue, but I resolved it by following below composer @prince thanks for your effort to provide an answer

    {
    "name": "vendorname/modulename",
    "description": "extension",
    "type": "magento2-module",
    "version": "1.0.1",
    "authors": [
        {
            "name": "w3solver",
            "email": "query@w3solver.com",
            "homepage": "http://www.w3solver.com"
        }
    ],
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [ "registration.php" ],
        "psr-4": {
            "Vendorname\\Modulename\\": ""
        }
    },
    "keywords": [
        "magento2",
        "magento 2",
        "qrcode",
        "qrcode generator"
    ]
}
0

Try this composer.json

    {
        "name": "vendorname/module-modulename",
        "description": "",
        "license": "proprietary",
        "authors": [
            {
                "name": "w3solver",
                "email": "query@w3solver.com"
            },
            {
                "name": "Your Name",
                "email": "email@email.com"
            }
        ],
        "minimum-stability": "dev",
        "require": {},
        "autoload": {
            "psr-4": {
                "Vendorname\\Modulename\\": ""
            },
            "files": [
                "registration.php"
            ]
        }

}

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.