solr – yii2作曲家更新致命错误 - 代码日志

solr – yii2作曲家更新致命错误

当我更新我的作曲家添加yii2-solr扩展到我的项目,我遇到一个错误,如下所示:

The "yiisoft/yii2-composer" plugin requires composer-plugin-api 1.0.0, this *WILL* break in the future and it should be fixed ASAP (require ^1.0 for example).
The "fxp/composer-asset-plugin" plugin requires composer-plugin-api 1.0.0, this *WILL* break in the future and it should be fixed ASAP (require ^1.0 for example).

PHP Fatal error:  Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272

Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272

在此之前,我已经运行作曲家自我更新,但仍然无法正常运行

composer global require "fxp/composer-asset-plugin:1.0.1"

再次出现上述错误。
这是我的composer.json文件内容:

{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Project Template",
"keywords": ["yii2", "framework", "basic", "project template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
    "issues": "https://github.com/yiisoft/yii2/issues?state=open",
    "forum": "http://www.yiiframework.com/forum/",
    "wiki": "http://www.yiiframework.com/wiki/",
    "irc": "irc://irc.freenode.net/yii",
    "source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "stable",
"require": {
    "php": ">=5.4.0",       
    "yiisoft/yii2": ">=2.0.5",
    "yiisoft/yii2-bootstrap": "*",
    "yiisoft/yii2-swiftmailer": "*",
    "filsh/yii2-oauth2-server": "*",
    "johnitvn/yii2-rbac-plus": "*",
    "yiisoft/yii2-sphinx": "^2.0",
    "yiisoft/yii2-solr": "*"
},
"require-dev": {
    "yiisoft/yii2-codeception": "*",
    "yiisoft/yii2-debug": "*",
    "yiisoft/yii2-gii": "*",
    "yiisoft/yii2-faker": "*"
},
"config": {
    "process-timeout": 1800
},
"scripts": {
    "post-create-project-cmd": [
        "yii\\composer\\Installer::postCreateProject"
    ]
},
"extra": {
    "yii\\composer\\Installer::postCreateProject": {
        "setPermission": [
            {
                "runtime": "0777",
                "web/assets": "0777",
                "yii": "0755"
            }
        ],
        "generateCookieValidationKey": [
            "config/web.php"
        ]
    },
    "asset-installer-paths": {
        "npm-asset-library": "vendor/npm",
        "bower-asset-library": "vendor/bower"
    }
}

}

如何解决这个错误?
谢谢。

1)删除旧版本的Composer Asset Plugin:

composer global remove "fxp/composer-asset-plugin"

2)安装较新版本。现在安装的推荐版本(在写这个时候)1.1.1(见official docs)。

composer global require "fxp/composer-asset-plugin:~1.1.1"

我甚至建议使用:

composer global require "fxp/composer-asset-plugin:*"

3)在项目文件夹中运行composer install。如果发生错误,请删除供应商文件夹内容和composer.lock文件,并再次运行composer install。

http://stackoverflow.com/questions/35009041/yii2-composer-update-fatal-error

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:solr – yii2作曲家更新致命错误