如何在Laravel 5.3中安装Jaxon 2.0

时间:2017-05-27 17:30:55

标签: php laravel-5.3

美好的一天。

我按照教程指示进行安装。

安装

在composer.json文件中添加以下行,然后运行composer update命令。

"require": {
    "jaxon-php/jaxon-laravel": "~2.0"
}

但我收到以下错误:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package jaxon-php/jaxon-laravel ~2.0 is satisfiable by jaxon-php/jaxon-laravel[v2.0-beta.1, v2.0-beta.2, v2.0-beta.3, v2.0-beta.4, v2.0-beta.5, v2.0-beta.6] but these conflict with your requirements or minimum-stability.

这是我的composer.json文件:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*",
        "laravelcollective/html": "^5.3.0",
        "yajra/laravel-datatables-oracle": "^6.20",
        "elibyy/tcpdf-laravel": "5.3.*",
        "iatstuti/laravel-nullable-fields": "~1.0",
        "orangehill/iseed": "2.2",
        "jaxon-php/jaxon-laravel": "~2.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

有什么想法吗?谢谢。

1 个答案:

答案 0 :(得分:0)

谷歌搜索我认为我发现了我的问题:

由于jaxon处于BETA版本且作曲家默认最小稳定性要求是稳定的,因此作曲家无法安装该软件包。

我将这2行添加到我的composer.json:

"minimum-stability": "beta",
"prefer-stable": true,

来源: http://webtips.krajee.com/setting-composer-minimum-stability-application/ https://getcomposer.org/doc/04-schema.md#minimum-stability