PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 29, 2022

[FIXED] Why can't I download my package through packagist?

 January 29, 2022     composer-php, package-managers, packages, packagist, php     No comments   

Issue

I have developed a library and I decided to throw it to the packagist. My composer.json looks like the following

{
    "name": "kamranahmedse/php-geocode",
    "type": "library",
    "description": "A wrapper around the Google Geocoding API to get different details such as latitude, longitude, country, city, district, postcode, town and street number regarding some specific address.",
    "keywords": ["location", "address", "addresses", "google", "map", "maps", "gmap", "gmaps", "geocode", "geocoder", "geocoding"],
    "homepage": "https://github.com/kamranahmedse/php-geocode",
    "license": "MIT",
    "authors": [
        {
            "name": "Kamran Ahmed",
            "homepage": "http://kamranahmed.info",
            "role": "Developer"
        }
    ],
    "autoload": {
        "psr-0": {
            "Geocode": "src/"
        }
    },
    "require": {
        "php": ">=5.2.0"
    }
}

and I have hosted my package at https://packagist.org/packages/kamranahmedse/php-geocode and the associated git repository is https://github.com/kamranahmedse/php-geocode. Now to test if my package is working fine, what I did was create a folder. Inside that folder I created this simple composer.json file containing

{
    "require": {
        "kamranahmedse/php-geocode": "*"
    }
}

But whenever I try to run composer install, I'm getting the following error:

Your requirements could not be resolved to an installable set of packages.

Problem 1 - The requested package kamranahmedse/php-geocode could not be found in any version, there may be a typo in the package name.

Can anyone please have a look and see what I'm doing wrong here? I've been trying and trying but unable to find any errors as this would be my first package over packagist and I have no prior experience.


Solution

I belive it's because you don't have any stable releases, and composer defaults to only downloading stable releases when * is specified.

Either change your version specification to dev-master or set your minimum-stability to dev.



Answered By - Kevin M Granger
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing