2

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.

2
  • I can't see any stable (aka versioned) release, just the master branch. Your local Composer setup is probably set to only install stable versions. Mar 21, 2017 at 12:08
  • how to add that and whats the importance of that?? Mar 21, 2017 at 12:09

4 Answers 4

1

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
5
  • in which composer i have to add the minimum stability .. as i added in ibm-watson repo and tried to install it shows same error do i have to add in the compose.json where i am trying to download it ..? Mar 21, 2017 at 12:16
  • In the project you want to use your library in. Mar 21, 2017 at 12:18
  • 1
    Downgrading minimum-stability may work for you in this one case, but is a bad idea; just tag your versions.
    – Narf
    Mar 21, 2017 at 12:32
  • What Narf said ;) Mar 21, 2017 at 12:33
  • At least, if you really need to use the development version of a particular package, please do not lower the minimum-stability flag for all your dependencies, but rather explicitly require the dev version of this particular package: composer require merajsiddiqui/ibm-watson:dev-master
    – xabbuh
    Mar 21, 2017 at 13:33
1

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.

0

Go to:

https://packagist.org/

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?

2
0

Add "minimum-stability": "dev" in your composer json file or release version of your library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.