1

I'm trying to install Yii2 via Composer (OS X El Capitan 10.11.3).

I did this

php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"

and then

php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.9

and I've got errors like

yiisoft/yii2 2.0.9 requires bower-asset/jquery 2.2.@stable | 2.1.@stable | 1.11.@stable | 1.12.@stable -> no matching package found. 

I don't know why it happens. I tried to reinstall (composer and asset-plugin), diff version as well and again the same problem with yiisoft/yii2 2.0.9 requires bower-asset/jquery 2.2.@stable

jaydel
  • 14,389
  • 14
  • 62
  • 98

2 Answers2

0

Try to install composer global require "fxp/composer-asset-plugin: *" first. Also, make sure you have these added in your composer.json file:

"extra": {
    "asset-installer-paths": {
        "npm-asset-library": "vendor/npm",
        "bower-asset-library": "vendor/bower"
    }
}

Another solution is to attempt to self-update:

composer self-update --rollback

If these solutions did not work, you can try to use this sequence of commands:

rm -rf ~/.composer/vendor
rm ~/.composer/composer.lock
cd ~/.composer
composer clear-cache
composer self-update
composer global require "fxp/composer-asset-plugin:~1.1.3"
composer install

Source 1 | Source 2 | Source 3 | Source 4

Community
  • 1
  • 1
Gynteniuxas
  • 7,035
  • 18
  • 38
  • 54
  • thanks! I've already tried all these solution before and they didn't work out the problem. using "composer self-update --rollback" : [UnexpectedValueException] Composer rollback failed: no installation to roll back to in "/Users/Me/.composer" – Vladimir Vasilev Aug 16 '16 at 08:43
  • What about if just `composer install`? Or, at the last case, reinstall composer completely (try different settings). – Gynteniuxas Aug 16 '16 at 09:52
  • if just `composer install` than `Nothing to install or update`. what settings do you mean? I've tried to install different versions and using `php composer.phar` also – Vladimir Vasilev Aug 19 '16 at 17:33
  • If you're downloading installer, then you have different settings to choose from. No need to use bash commands. – Gynteniuxas Aug 19 '16 at 17:55
0
composer global require "fxp/composer-asset-plugin:~1.1.1"

composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application

The first command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer. You only need to run this command once for all.

The second command installs the latest stable version of Yii in a directory named basic. You can choose a different directory name if you want.

Muhammad Shahzad
  • 9,340
  • 21
  • 86
  • 130