Reputation: 2065
I have so far been able to publish my package on packagist. From my repository, http://github.com/pbalan/directory-parser
I followed How to create a library to be used by composer autoloading?
When I try to install the same using composer, I am unable to do so. Composer fails saying:
Loading composer repositories with package information
Reading composer.json of pbalan/directory-parser (0.0.1)
Importing tag 0.0.1 (0.0.1.0)
Reading composer.json of pbalan/directory-parser (master)
Importing branch master (dev-master)
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package pbalan/directory-parser 1.0.0 could not be found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
Here's my composer I have in my github repository:
{
"name" : "pbalan/directory-parser",
"description" : "DirectoryParser",
"license": "MIT",
"keywords" : ["DirectoryParser"],
"homepage" : "https://github.com/pbalan/directory-parser",
"authors" : [
{
"name" : "prashant"
}
],
"autoload" : {
"psr-0" : {"src" : ""}
},
"require" : {
"php": ">=5.3.3"
}
}
And I am trying to install in a fresh directory using this composer.json:
{
"name" : "pbalan/directory-parser",
"description" : "DirectoryParser",
"license": "MIT",
"keywords" : ["DirectoryParser"],
"homepage" : "https://github.com/pbalan/directory-parser",
"authors" : [
{
"name" : "prashant"
}
],
"repositories": [
{
"type": "vcs",
"url": "http://github.com/pbalan/directory-parser.git"
}
],
"require" : {
"php": ">=5.3.3",
"pbalan/directory-parser": "dev-master"
}
}
I changed my composer.json now to a point where I have no errors, however I am not able to install the package and just install autoloader files.
How could I get my package installed? Please help!
Upvotes: 1
Views: 3002
Reputation: 11423
The problem is probably that you are re-using the name of your package in the second composer.json
.
Simply use this as the composer.json
for your empty directory:
{
"require": {
"php": ">=5.3.3",
"pbalan/directory-parser": "dev-master"
}
}
That's all! You don't need all the extra information such as name, description etc. unless you are creating another library that should be available on Packagist as well.
Upvotes: 2