3

I have a git repo https://github.com/hounded/FPDFbundle

I have added it to packagist https://packagist.org/packages/hounded/fpdfbundle

You can see the composer.json at the git repo

{
"name" : "hounded/fpdfbundle",
"description" : "A pdf bundle",
"type" : "symfony-bundle",
"authors" : [{
 "name" : "James Whiteman"
}],
"keywords" : ["pdf bundle"],
"license" : ["MIT"],
"require" : {
"symfony/framework-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2"
},
"autoload" : {
"psr-0" : {
  "hounded\\FPDFBundle" : ""
}
},
"target-dir" : "hounded/FPDFBundle",
"extra" : {
"branch-alias" : {
  "dev-master" : "0.1.x-dev"
}
},
"minimum-stability": "dev"
}

However when I run

composer require hounded/fpdfbundle 

I get "could not find package hounded/fpdfbundle"

I would like to help the community but am stumped as to what I have done wrong

hounded
  • 666
  • 10
  • 21
  • Could you please try ````"hounded/fpdfbundle": "dev-master"```` ? – Praveesh Sep 01 '15 at 05:35
  • 1
    You will have to update the stability flag of the package in the package repository. Otherwise, the stability flag needs to be specified in the ````package.json```` file whenever someone is trying to install this package. – Praveesh Sep 01 '15 at 05:42
  • Hi Pravessh thank you for responding, is package.json for node js? I tried "hounded/fpdfbundle": "dev-master", with no luck. I also tried changing the minimum-stability: stable, still no luck – hounded Sep 01 '15 at 05:56
  • 1
    My bad, it should be composer.json instead of package.json. I was able to install the package by adding ````"hounded/fpdfbundle": "dev-master"```` to my composer.json file. – Praveesh Sep 01 '15 at 05:58
  • hey man, if you want to answer this question with a small explaination why composer require hounded/fpdf won't work and why composer require "hounded/fpdfbundle": "dev-master" does I will mark it as correct and upvote – hounded Sep 01 '15 at 06:05

1 Answers1

2

Your github repo contains no tags. When the github repo contains no tags, packageist sets "dev" as the default version for your package. Composer has some minimum stability criteria by which it will not install a package with version as "dev" unless you explicitely specify in the composer.json file. So, to fix this issue, add a version number tag to your github repo by using something like

git tag -a 1.0.0

and then push the changes to your public repo. Once you push, packageist will scan for changes and detect the version/tag and set it as the active version.

Praveesh
  • 1,257
  • 1
  • 10
  • 23