Rahul Reghunath
Rahul Reghunath

Reputation: 1276

Newly submitted Package in Packagist showing errors while running composer require

I have created a simple PHP-validation plugin. I submit it in Packagist.Everything in Packagist seems fine but when I run my composer require command

composer require rahulreghunath11/php-rvalidation

Could not find package rahulreghunath11/php-rvalidation at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

showing this error.

my composer file is

{
    "name": "rahulreghunath11/php-rvalidation",
    "type": "library",
    "description": "PHP form validation plugin ",
    "keywords": ["validation","bootstrap validation"],
    "homepage": "https://github.com/rahulreghunath11/php-form-validation",
    "license": "MIT",
    "authors": [
        {
            "name": "Rahul Reghunath",
            "email": "[email protected]",
            "role": "developer"
        }
    ]
}

any idea?

Upvotes: 0

Views: 204

Answers (1)

rickdenhaan
rickdenhaan

Reputation: 11328

That error means that the composer.json file for your project (NOT your validation plugin) is missing a minimum-stability indicator that allows development packages, so it's defaulting to stable.

Your validation plugin is only available as dev-master, because you haven't tagged any releases in Github yet. That means that in order for the require to work, you either have to explicitly tell it to fetch dev-master, or you need to set minimum-stability for your project to dev.

Edit:

To tell your project to use the dev-master package, specify it manually in your (project) composer.json file:

{
    "name": "example/example-app",
    "require": {
        "rahulreghunath11/php-rvalidation": "dev-master"
    }
}

Alternatively, if you want to be able to use composer require from the commandline and have it add the dev-master version automatically, set the minimum-stability to dev in your (project) composer.json file:

{
    "name": "example/example-app",
    "minimum-stability": "dev",
    "require": {
    }
}

Now composer will let you add packages that do not have releases:

composer require rahulreghunath11/php-rvalidation

Upvotes: 1

Related Questions