0

Any idea why the composer is throwing error of:

[InvalidArgumentException]
  Could not find a matching version of package divix1988/laminas-smarty-module. Check the package spelling, your vers
  ion constraint and that the package is available in a stability which matches your minimum-stability (stable).

When trying to add my own new dependency via: composer require divix1988/laminas-smarty-module ?

https://github.com/divix1988/laminas-smarty-module

divix
  • 1,265
  • 13
  • 27
  • Seems like you are trying to add a private package, typically they need to be in packagist. Here are a couple of resources on it. https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md https://barryvanveen.nl/blog/55-installing-a-private-package-with-composer – EternalHour Feb 28 '20 at 00:00
  • 1
    How **exactly** did you configure all that? I haven't found your package on Packagist – Nico Haase Feb 28 '20 at 09:21
  • Does this answer your question? [Use PHP composer to clone git repo](https://stackoverflow.com/questions/12954051/use-php-composer-to-clone-git-repo) – Nico Haase Feb 28 '20 at 09:22
  • Thank you @NicoHaase you are right, I need to add it to packagist first. – divix Feb 29 '20 at 20:31

2 Answers2

2

There are 2 ways:


    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:divix1988/laminas-smarty-module.git"
        }
    ],
kuba
  • 3,670
  • 3
  • 31
  • 41
1

To get a package via composer you have to add it to packagist before. Login packagist from here and then add your package. When your package is presente on packagist, you can require it using composer.

sensorario
  • 20,262
  • 30
  • 97
  • 159