0

I'm developing and trying to install a module through composer in Magento. My module's composer.json looks like this

{
  "name": "amit/test",
  "description": "N/A",
  "require": {
    "php": "~5.6.0|7.0.2|~7.0.6",
    "magento/module-store": "100.1.*",
    "magento/module-backend": "100.1.*",
    "magento/module-cron": "100.1.*",
    "magento/framework": "100.1.*"
  },
  "type": "magento2-module",
  "version": "100.1.0",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Amit\\Test\\": ""
    }
  }
}

When I'm running command composer require amit/test from root of my project it gives error

[InvalidArgumentException]
Could not find package amit/test at any version for your minim
um-stability (alpha). Check the package spelling or your minimum-stability

Question: As my module is still not in a packages repository such as packagist.org, or packages.magento.com, is it compulsory to upload it to a VCS like github in order to install it through composer?

1 Answer 1

1

It has to be in some kind of repository and you have to define it in the "repositories" section of the project's composer.json.

For possible repository types see: https://getcomposer.org/doc/05-repositories.md

A VCS (i.e. Git) is the best choice, but it does not have to be publicly accessible (i.e. GitHub)

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.