Max Koretskyi
Max Koretskyi

Reputation: 105497

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?

Upvotes: 3

Views: 2774

Answers (4)

Penn Evam
Penn Evam

Reputation: 383

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"
}

Upvotes: 0

David J Eddy
David J Eddy

Reputation: 2037

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

Upvotes: 1

sanmai
sanmai

Reputation: 30891

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

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

Upvotes: 1

aidonsnous
aidonsnous

Reputation: 1503

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

Upvotes: 1

Related Questions