Skip to content

Instantly share code, notes, and snippets.

@srmklive
Created April 7, 2016 07:22
Show Gist options
  • Save srmklive/f5d43315d4273e94ab69bf3a3a467f20 to your computer and use it in GitHub Desktop.
Save srmklive/f5d43315d4273e94ab69bf3a3a467f20 to your computer and use it in GitHub Desktop.
Composer update error
When running any composer commands, sometimes you see the following error stack:
```
[ReflectionException]
Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist
[ErrorException]
Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository::whatProvides() shou
ld be compatible with Composer\Repository\ComposerRepository::whatProvides(Composer\DependencyRe
solver\Pool $pool, $name, $bypassFilters = false)
```
To correct this, you need to install/update **fxp/composer-asset-plugin** plugin. You can do that by running the following commands:
```
composer global require fxp/composer-asset-plugin --no-plugins // For installing it first time
composer global update fxp/composer-asset-plugin --no-plugins // For updating plugin, if already installed
```
@webexfavorhero
Copy link

Great!!
Thank you, very helpful

@Alex100dre
Copy link

Working for me, thanks so much!

@skybluewill
Copy link

Thank you, It's working for me. But Somebody should do it on the composer folder, it not work folder(Even if you set global environment variables on the Windows ).
translate to Chinese:谢谢,这对我来说很有用。但是得注意的是:必须在composer 目录,而不是工作目录(即使你在Windows设置了全局变量)

composer global require fxp/composer-asset-plugin --no-plugins // 第一步 安装
composer global update fxp/composer-asset-plugin --no-plugins // 第二步 升级插件

@OleksiiBrylin
Copy link

Thank you, very helpful

@l174rd
Copy link

l174rd commented Sep 5, 2016

Helped me! Thank you!

@mohammad1381
Copy link

mohammad1381 commented Nov 5, 2016

I have done all of these, but still I had the same problem. I removed vendor/fxp and it fixed.

@IvoPereira
Copy link

I have been trying all kind of solutions and the only way I was able to fix it was following the steps mentioned here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment