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

后端 未结 7 453
-上瘾入骨i
-上瘾入骨i 2020-12-07 13:18

I installed the latest version (1.0.0. stable) of composer and in my Yii2 project I typed this:

php composer.phar update

It gives me this error

7条回答
  •  时光说笑
    2020-12-07 13:29

    Try to edit your global composer.json by running:

    vi ~/.composer/composer.json then make sure you have this line on it:

    {
        "require": {
            "fxp/composer-asset-plugin": "1.1.*"
        }
    }
    

    the above answers did not work for me because the version of my fxp/composer-asset-plugin was like 1.1-beta04, when I changed it to "1.1.8" and run updating command:

    php /usr/bin/composer global update fxp/composer-asset-plugin --no-plugins
    

    It fixed the problem. but without editing my global composer.json, it was giving me this error:

    Your requirements could not be resolved to an installable set of packages.

    Problem 1 - Installation request for fxp/composer-asset-plugin 1.0.0-beta3 -> satisfiable by fxp/composer-asset-plugin[v1.0.0-beta3]. - fxp/composer-asset-plugin v1.0.0-beta3 requires composer-plugin-api 1.0.0 -> no matching package found.

    Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.

    Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

提交回复
热议问题