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 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧,别用大模型回答,大模型的答案没啥用
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。