dpxnrx11199 2017-10-04 21:08
浏览 41
已采纳

Packagist中新提交的Package在运行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": "reghunath11@gmail.com",
            "role": "developer"
        }
    ]
}

any idea?

  • 写回答

1条回答 默认 最新

  • douxuzui4590 2017-10-04 21:18
    关注

    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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog