更新作曲家引发异常类Fxp\Composer\AssetPlugin\Repository\NpmRepository不存在 [英] Updating composer throws exception Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

查看:139
本文介绍了更新作曲家引发异常类Fxp\Composer\AssetPlugin\Repository\NpmRepository不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近为Yii2基本应用模板运行了最新的composer安装。

I recently ran latest composer installation for a Yii2 basic application template.

但是运行 php composer.phar install 引发此异常:


Fxp\Composer\AssetPlugin\Repository\NpmRepository不存在

Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

yiisoft / yii2-composer插件需要composer-plugin-api 1.0.0,
WIL L 将来会中断并且应该尽快修复(例如,需要
^ 1.0)。

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

[ReflectionException]类
Fxp\Composer\AssetPlugin\ Repository\NpmRepository不存在

[ReflectionException] Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

[ErrorException]

[ErrorException]


Fxp\Composer的声明\AssetPlugin\Repository\AbstractAssetsRepository :: w
hatProvides()应该与
Composer\Repository\ComposerRepository ::
whatProvides(Composer\DependencyResolver\Pool $池,$ name,
$ bypassFilters = fal se)

Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository::w hatProvides() should be compatible with Composer\Repository\ComposerRepository:: whatProvides(Composer\DependencyResolver\Pool $pool, $name, $bypassFilters = fal se)

这是我的composer.json:

Here is my 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": "*"

    },
    "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"
        }
    }
}

可能出了什么问题?有人遇到这个问题吗?

What could have gone wrong? Anyone experiencing this?

推荐答案

像错误消息一样:

yiisoft / yii2-composer插件需要composer-plugin-api 1.0.0,将来会中断,应尽快修复(例如,需要^ 1.0)。

尝试更新您的 fxp / composer-asset-plugin

php composer.phar全局更新fxp / composer-asset-plugin --no-plugins

PS:如果更新后仍然无法使用,请尝试以下操作:

PS: If after update it still not working, try also following:

composer global require fxp / composer-asset-plugin-没有插件

这篇关于更新作曲家引发异常类Fxp\Composer\AssetPlugin\Repository\NpmRepository不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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