0

I have created a private package at packagist.org under new organisation. Here are the steps i took so far:

  1. Developed a lumen package at local instance.
  2. Configured composer.json to be used with private composer package.
  3. Pushed the local package to private github repo.
  4. Added the package by URL at packagist.org and all the api token and credentials has also been setup.
  5. The project get added without any error.
  6. I have added the composer global auth token to require private package.
  7. When i either search or require the package to new lumen instance i get the error

[InvalidArgumentException]
Could not find a matching version of package grv/contentfeed. Check the pac
kage spelling, your version constraint and that the package is available in
a stability which matches your minimum-stability (dev).

This is how my composer.json looks like:

{
"name": "grv/contentfeed",
"description": "This is yet another Lumen composer package wrapper",
"type": "elx-core-plugin",
"version": "1.2.3",
"keywords": ["demo","lumen","drupal"],
"homepage": "https://github.com/gauravmehrasrijan/elx-feed",
"require": {
    "composer/installers": "^1.0.24"
},
"autoload": {
    "psr-4": {
        "Grv\\Contentfeed\\": "/src"
    }
},
"license": "MIT",
"minimum-stability": "dev",
"extra": {
    "laravel": {
        "providers": [
            "Grv\\Contentfeed\\ContentFeedServiceProvider"
        ]
    }
},
"authors": [
    {
        "name": "Gaurav Mehra",
        "email": "gauravmehra1987@gmail.com"
    }
],
"repositories": [
    {"type": "composer", "url": "https://repo.packagist.com/grvatsrijan/"},
    {"packagist.org": false}
]

}

Are there some more steps to it that i am missing. I have even tried creating new packages with different namespace but no success.

Gaurav Mehra
  • 471
  • 7
  • 20

1 Answers1

0

It turned out that i was adding this piece of code at wrong place.

"repositories": [
{"type": "composer", "url": "https://repo.packagist.com/grvatsrijan/"},
{"packagist.org": false}

]

Instead of adding it to created composer package, this will need to go in the consumer composer package( where i am trying to require this package ).

Adding "repositories" key to composer.json will allow composer to search for private package within the https://repo.packagist.com/grvatsrijan/

Gaurav Mehra
  • 471
  • 7
  • 20