问题
Since the fxp\composer-asset-plugin broke last year, I am continuously experiencing problems installing yii2.
whenever I run a composer update command it fails due to this composer asset plugin. Everyday a new error pops up. I have read number of articles, github issues, with Sam and Alexander (maintainers of Yii Framework) continuously replying to the same problem then would close the topic. none of the updates to this plugin seem to be a fool-proof solution.
Now instead of asking how to solve the errors caused by this plugin (assuming that no one has a 100% working solution till date, only workarounds that work only 'sometimes'),
how do I get rid of this plugin and can't I manually install the packages through bower or npm?
In short, I mean,
In Yii 2.0, is life possible without this plugin, which has become a problem creator instead of solving problems.
回答1:
You can use https://asset-packagist.org instead. Add this in composer.json:
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
Only problem is assets are installed in the different folder so you need to change the aliases. Add this in some common config file:
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
来源:https://stackoverflow.com/questions/42731517/how-do-i-get-rid-of-composer-asset-plugin-in-yii2