Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - Could not find a matching version of package in magento

I'm trying to install a module from github using composer, but every time I'm getting same error,

[InvalidArgumentException]
  Could not find a matching version of package Worldpay/Worldpay-Magento2-CG.
   Check the package spelling, your version constraint and that the package i
  s available in a stability which matches your minimum-stability (dev).

Below is my part of composer.json,

 "minimum-stability": "dev",
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        "Worldpay-Worldpay-Magento2-CG": {
            "type": "git",
            "url": "https://github.com/Worldpay/Worldpay-Magento2-CG.git"
        }
    },

Below are the command list I have tried,

composer require Worldpay/Worldpay-Magento2-CG dev-master
composer require Worldpay/Worldpay-Magento2-CG:~2.0
composer require Worldpay/Worldpay-Magento2-CG @master
composer require Worldpay/Worldpay-Magento2-CG @dev-master
composer require Worldpay/Worldpay-Magento2-CG "^2.0"
composer require Worldpay/Worldpay-Magento2-CG:dev/master

(small letter)

composer require worldpay/worldpay-magento2-cg:dev-master

I have tried with ssh link also in composer.json. And with out "minimum-stability": "dev", part.

The current latest version of this module is 2.0. And the stable branch is Master. I have tried to get directly that version and the branch with above commands. But every time I'm getting same error message.

And additionally latest version (2.0) of that module is not listed in packagist

https://packagist.org/packages/sapient/module-worldpay

In packagist the latest version is showing as 1.5.3. After that I have done 4 releases. But it is not available in packagist. Should I submit manually ?.

So seems like somewhere I did mistake. Should I create Stable (branch name) branch in github ?. Any advise will be really great.

like image 240
Elavarasan Avatar asked May 15 '19 11:05

Elavarasan


1 Answers

For composer require command you should use package name defined in composer.json, URL of repository is irrelevant. So it should be something like:

composer require sapient/module-worldpay:dev-master

And additionally latest version (2.0) of that module is not listed in packagist

You should probably configure GitHub hooks to inform Packagist about repo updates, see https://packagist.org/about#how-to-update-packages

like image 185
rob006 Avatar answered Sep 19 '22 23:09

rob006