Reputation: 2205
I am writing a php library and i published it on packagist but am unable to download it using composer
composer require merajsiddiqui/ibm-watson
But it throws error
[InvalidArgumentException]
Could not find package merajsiddiqui/ibm-watson at any version for your min
imum-stability (stable). Check the package spelling or your minimum-stabili
ty
Here is my repository: https://github.com/merajsiddiqui/ibm-watson
I would be thankful if you can guide me to successfully publishing so any one can download this library.
Upvotes: 2
Views: 3908
Reputation: 6637
This is because your package is still in "dev" mode.
Add a tag to your repository, publish the tagged (versioned) repo.
Or add this to your composer.json:
"minimum-stability": "dev"
for example:
# composer.json
{
"name": "ProjectUsingMyIBMWatsonPackage",
"minimum-stability": "dev"
}
then run:
$ composer require merajsiddiqui/ibm-watson
Using version dev-master for merajsiddiqui/ibm-watson
(...)
- Installing merajsiddiqui/ibm-watson (dev-master f7b808d) Cloning f7b808dd97 from cache
Upvotes: 1
Reputation: 607
Add "minimum-stability": "dev"
in your composer json file or release version of your library.
Upvotes: 0
Reputation: 14752
minimum-stability: stable
means that development versions of the library cannot be installed - that's the default minimum-stability
setting. And for good reasons - a "dev" version changes constantly, and is thus unreliable.
You need to release an actual (non-RC, non-alpha, non-beta) version of your library for it to be considered "stable".
With Git, that means using git tag
.
Upvotes: 1
Reputation: 27285
Go to:
and create a package from your repo. Then it's available. Otherwise you have to add your repo in your composer configuration manually.
https://getcomposer.org/doc/05-repositories.md
The other problem is that your package is not marked es "stable" then your can't add them when your minimum stability
is stable
. So go to your composer.json
and set them to stable.
How to mark code as stable using Composer?
Upvotes: 0