通过composer安装laravel包时的InvalidArgumentException组合器

时间:2016-01-17 15:33:27

标签: laravel composer-php

我用laravel打包器在laravel中创建了一个包,我将它推送到我的github帐户并提交给Packagist。当我点击

composer require mortezarajabi/jdate

在根目录中,我得到了

    [InvalidArgumentException]                                                   
      Could not find package mortezarajabi/jdate at any version for your minimum-  
      stability (stable). Check the package spelling or your minimum-stability
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]...

这是我的作曲家

{
    "name": "mortezrajabi/jdate",
    "type": "library",
    "description": "Jalali(Falaki) date for laravel",
    "keywords": [
        "mortezarajabi",
        "jdata"
    ],
    "homepage": "https://github.com/mortezarajabi/jdate",
    "license": "MIT",
    "authors": [
        {
            "name": "mortezarajabi",
            "email": "emortezarajabi@gmail.com",
            "homepage": "http://mortezarajabi.com",
            "role": "Developer"
        }
    ],
    "require": {
        "illuminate/support": "~5",
        "php" : ">=5.4.0"
    },
    "autoload": {
        "psr-4": {
            "rajabi\\jdate\\": "src"
        }
    }
}

任何建议?

1 个答案:

答案 0 :(得分:1)

问题是你在Git中没有包tag。 Packagist使用标签进行包版本控制。它将使用您的最新代码作为composer require mortezarajabi/jdate中的默认版本。

因此,如果您只想使用master分支,则可以在 composer.json 中对其进行操作,如下所示:

"require": { "mortezarajabi/jdate" : "dev-master" }
"minimum-stability": "dev"

然后你可以:

composer update