作曲者:具有不同水平的最小稳定性的所需包 [英] Composer: required packages with differing levels of minimum-stability

查看:165
本文介绍了作曲者:具有不同水平的最小稳定性的所需包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于laravel安装的composer文件,其中包含以下composer.json文件:

I have a composer file for a laravel installation with the following composer.json file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.1.*"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

我试图在sentry的包中添加。在sentry的网站上,它说我可以通过添加以下到我的composer.json文件安装:

I'm trying to add in the bundle for sentry. On sentry's website it says I can install it by adding the following to my composer.json file:

{
    "require": {
        "cartalyst/sentry": "2.0.*"
    },
    "minimum-stability": "dev"
}

我试着在当前laravel的末尾添加新的json对象,如下所示:

I tried adding the new json object at the end of the current laravel one like so:

...
},
{
    "require": {
        "cartalyst/sentry": "2.0.*"
    },
    "minimum-stability": "dev"
}

当我运行 composer update 命令加载新包时,我得到一个错误,说新对象添加是无效的json。

When I run the composer update command to load the new package I get an error saying that the new object addition is not valid json.

如果我将 cartalyst / sentry 添加到现有的 require 对象,找到sentry包,因为现有的需求的最小稳定性值为 stable

If I add the cartalyst/sentry to the existing require object it cannot find the sentry package because the existing requires have a minimum-stability value of stable.

在具有 dev

推荐答案

答案只是添加 @dev

{
    "require": {
        "cartalyst/sentry": "2.0.*@dev"
    },
}

您可以阅读更多关于此处的最小稳定性设置

另一种方法是将最小稳定性设置为dev,但告诉作曲者要尽可能使用stable: p>

An alternative is to set your minimum-stability to dev, but tell composer you want to use stable whenever possible:

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

这基本上意味着它总是使用稳定UNLESS没有办法安装一个稳定的依赖,因此使用dev。

This basically means it will always use stable UNLESS there is no way to install a stable dependency, and therefore use dev.

这篇关于作曲者:具有不同水平的最小稳定性的所需包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆