简体   繁体   English

Packagist中新提交的软件包,在运行作曲家时显示错误要求

[英]Newly submitted Package in Packagist showing errors while running composer require

I have created a simple PHP-validation plugin. 我创建了一个简单的PHP验证插件。 I submit it in Packagist.Everything in Packagist seems fine but when I run my composer require command 我在Packagist中提交了它.Packagist中的所有内容似乎都很好,但是当我运行作曲家require命令时

composer require rahulreghunath11/php-rvalidation

Could not find package rahulreghunath11/php-rvalidation at any version for your minimum-stability (stable). 无法找到任何版本的rahulreghunath11 / php-rvalidation软件包,以确保您的最低稳定性(稳定)。 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": "reghunath11@gmail.com",
            "role": "developer"
        }
    ]
}

any idea? 任何想法?

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. 该错误意味着您的项目( 不是验证插件)的composer.json文件缺少允许开发包的minimum-stability指示器,因此默认情况下为稳定。

Your validation plugin is only available as dev-master , because you haven't tagged any releases in Github yet. 您的验证插件仅可用作dev-master ,因为您尚未在Github中标记任何发行版 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 . 这意味着为了使需求能够正常工作,您必须明确地告诉它获取dev-master ,或者您需要为dev的项目设置minimum-stability

Edit: 编辑:

To tell your project to use the dev-master package, specify it manually in your (project) composer.json file: 要告诉您的项目使用dev-master软件包,请在您的(项目) composer.json文件中手动指定它:

{
    "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: 另外,如果您希望能够从命令行使用composer require并自动添加dev-master版本,请在您的(项目) composer.json文件中为dev设置minimum-stability

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

Now composer will let you add packages that do not have releases: 现在,composer将允许您添加没有发布的软件包:

composer require rahulreghunath11/php-rvalidation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM