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

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP