简体   繁体   English

作曲家Yii2 - 安装kartik

[英]Composer Yii2 - install kartik

When I type: 当我输入:

php composer.phar require kartik-v/yii2-money "*" php composer.phar需要kartik-v / yii2-money“*”

./composer.json has been updated
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
    - yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - Installation request for yiisoft/yii2 == 2.0.1.0 -> satisfiable by yiisoft/yii2[2.0.1].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting

Installation failed, reverting ./composer.json to its original content.

I have Yii 2.0.1 installed on my server and here is my composer.json: 我在我的服务器上安装了Yii 2.0.1,这是我的composer.json:

{
    "name": "yiisoft/yii2-app-advanced",
    "description": "Yii 2 Advanced Application Template",
    "keywords": ["yii2", "framework", "advanced", "application template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",

    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "kartik-v/yii2-money": "*"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

Both extension and its required base have stable releases so I think this setting: 扩展及其所需的基础都有稳定的版本,所以我认为这个设置:

"minimum-stability": "stable"

shouldn't cause the error. 不应该导致错误。

Most likely you simply forgot to install composer asset plugin (read more in official documentation and extension page ). 很可能你只是忘了安装composer asset插件(在官方文档和扩展页面中阅读更多内容 )。 To install it just execute this command once: 要安装它,只需执行以下命令:

composer global require "fxp/composer-asset-plugin:1.0.0-beta4"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM