'Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

In this section of the yii2 installation guide there's the following instructions:

With Composer installed, you can install Yii by running the following commands under a Web-accessible folder:

composer global require "fxp/composer-asset-plugin:~1.0.3"

composer create-project --prefer-dist yiisoft/yii2-app-basic basic

The first command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer.

I've read about composer-asset-plugin here and seems that it's used to manage front-end dependencies through composer. As I'm not developing for front-end, do I need to install this plugin anyway?



Solution 1:[1]

Yes you do I was not able to install specific version of extension because of not installing it and it was solved after installing it. More details on this link Yii Framework forum post

Solution 2:[2]

Apparently you have to. Else you can't install Yii.

yiisoft/yii2 requires bower-asset/jquery *@stable -> no matching package found.

Solution 3:[3]

Correction: As per ./vendor/yiisoft/yii2/composer.json:

"require": {
    ...
    "bower-asset/jquery": "2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable",
    ...
}

fxp is, sadly, required. PR submitted to project https://github.com/yiisoft/yii2/issues/14265

Project owner has also stated here http://www.yiiframework.com/forum/index.php/topic/68361-do-i-need-to-install-fxpcomposer-asset-plugin-if-im-not-doing-front-end-development/page__p__290882#entry290882 that the fxp requirement will be removed in release 2.1

Solution 4:[4]

maybe you could try yidas/yii2-composer-bower-skip


In Yii2 composer.json, require yidas/yii2-composer-bower-skip before yiisoft/yii2.

Example composer.json:

"require": {
    "php": ">=5.4.0",
    "yidas/yii2-composer-bower-skip": "~2.0.5",
    "yiisoft/yii2": "~2.0.5",
    "yiisoft/yii2-bootstrap": "~2.0.0"
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 aidonsnous
Solution 2
Solution 3
Solution 4 Penn Evam