18
votes

I updated composer

composer self-update

I installed the newer version of the plugin

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

I try to install Laravel

composer global require "laravel/installer"

Changed current directory to C:/Users/Arthur/AppData/Roaming/Composer    
Fatal error: Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRe
    pository::search() must be compatible with Composer\Repository\RepositoryInterfa
    ce::search($query, $mode = 0, $type = NULL) in C:\Users\Arthur\AppData\Roaming\C
    omposer\vendor\fxp\composer-asset-plugin\Repository\AbstractAssetsRepository.php
     on line 334

Now all commands in composer not working

composer <any command>

Please help me to resolve it

3

3 Answers

37
votes

You can temporarily disable composer plugins with the --no-plugins option:

composer global remove fxp/composer-asset-plugin --no-plugins

See Composer docs - Global options:

--no-plugins: Disables plugins.

9
votes

To solve the above error while installing composer asset plugin please do the following

  1. delete fxp folder in the path C:\Users\UserName\AppData\Roaming\Composer\vendor

  2. remove "fxp/composer-asset-plugin": "^1.4" from composer.json file in composer folder

  3. run this command composer global remove fxp/composer-asset-plugin --no-plugins to make sure no fxp folder is left and json data

  4. composer global require fxp/composer-asset-plugin --no-plugins Run this command to install composer asset plugin and it will be installed easily

  5. If you want to update existing plugin, run this command

    composer global update fxp/composer-asset-plugin --no-plugins

0
votes