When I update my composer to add yii2-solr
extension to my project, I encounter with an error like below:
The \"yiisoft/yii2-composer\" plugin requi
1) Remove old version of Composer Asset Plugin:
composer global remove "fxp/composer-asset-plugin"
2) Install newer version. Recommended version for installation is now (by the moment of writing this) 1.1.1
(see official docs).
composer global require "fxp/composer-asset-plugin:~1.1.1"
I'd even recommend to use:
composer global require "fxp/composer-asset-plugin:*"
3) Run composer install
in your project folder. In case of errors, delete vendor
folder contents and composer.lock
file and run composer install
again.
If arogachev's answer doesn't exactly work for you, here is a quick fix.
composer global require "fxp/composer-asset-plugin:*"
That should be all. You will get all your files back and you can continue
You can require yidas/yii2-composer-bower-skip
before yiisoft/yii2
in composer.json
file:
"require": {
"php": ">=5.4.0",
"yidas/yii2-composer-bower-skip": "~2.0.0",
"yiisoft/yii2": ">=2.0.5",
"yiisoft/yii2-bootstrap": "*",
...
Then run composer update
.
This case is for that you don't need the update for Bower.
See https://github.com/yidas/yii2-composer-bower-skip
Rollback composer to 1.x version - the said plugin does not work (yet) with composer 2.x (as discussed here):
sudo composer self-update --rollback