I am trying to install a module which i created in magento 2 via composer, I have hosted the module on the bitbucket repository, and added the repository url in magento's composer.json, When i try to install the module using the following

composer require package/module

The prompt asks for username and password for


I know that this is not the repository from which i need to download the module, but to proceed further i need to provide the username and password which i suppose are the same we use to login for https://www.magentocommerce.com/magento-connect/

But somehow it gives the following error

E:\wamp\www\m2final>composer require package/module
You are running composer with xdebug enabled. This has a major impact on runtime
 performance. See https://getcomposer.org/xdebug
    Authentication required (repo.magento.com):
      Username: [email protected]
  Invalid credentials for 'https://repo.magento.com/packages.json', aborting.

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update]
[--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-
packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packag

After Clearing the above problems, i ran into another trouble, this has to do something with my repository structure,

I have created the repository names Magento Repository, and added the repository url in magento's composer.json

when i run the command composer require package/module i get the following error

  Could not find package package/module at any version for your minimum-stability
   (alpha). Check the package spelling or your minimum-stability

This is my module's directory structure in bitbucket

enter image description here

The folders in are directly created in the repository root

This is my Module's composer.json

  "name": "package/module",
  "description": "A Magento 2 module that creates a new page",
  "type": "magento2-module",
  "version": "1.0.0",
  "license": [
  "require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/framework": "~1.0.0"
  "autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Package\\Module\\": ""

1 Answer 1


The username and password that you are using are wrong.

You need to use the public and private key generated from http://magentocommerce.com/

For generating the keys login to http://magentocommerce.com/

Goto My Account > Developers > Secure Keys and generate the new key.

Now run composer require package/module command as usual. Then when you get prompted for username and password do the following:

Enter the public key that you just created in user name field and private key in password field.

Click on enter, and the error should be gone.

  • I got that solved, however i got another problem, i have updated the question for that, please see the portion after ---EDIT--- Commented Dec 2, 2015 at 11:28
  • may be this could help - stackoverflow.com/questions/22536978/… Commented Dec 2, 2015 at 11:34
  • I checked that, this does not sim to be the answer, maybe the problem is with my directory structure in the bitbucket repository? Commented Dec 2, 2015 at 12:10

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.