yii2 advanced template install with composer error

Created on 14 Feb 2016  Â·  15Comments  Â·  Source: yiisoft/yii2

Follow the document, I've tried to install yii2-advanced template with these commands:

composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application

and get errors:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - yiisoft/yii2 2.0.x-dev requires bower-asset/jquery.inputmask ~3.2.2 -> no matching package found.
    - yiisoft/yii2 dev-master requires bower-asset/jquery.inputmask ~3.2.2 -> no matching package found.
    - yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - Installation request for yiisoft/yii2 >=2.0.6 -> satisfiable by yiisoft/yii2[2.0.6, 2.0.7, dev-master, 2.0.x-dev].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

My composer is the latest version.

Please help to solve the problem, thank you.

question

Most helpful comment

@SilverFire

I had the same issue, solved running this command:
composer global require "fxp/composer-asset-plugin:^1.0"
before updating composer.json and running
composer update -o

All 15 comments

The problem may be caused by this line in yii2-advanced composer.json:

"minimum-stability": "dev",

I've faced similar problem caused by jquery.inputmask exactly.
I noticed that some their versions did not follow semver and thus resulted error when building dependencies.

You may work it around by adding --stability=stable option:

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

Output:

  - Installing yiisoft/yii2-composer (2.0.4)
    Downloading: 100%

  - Installing ezyang/htmlpurifier (v4.6.0)
    Downloading: 100%

  - Installing bower-asset/jquery (2.2.0)
    Downloading: 100%

  - Installing bower-asset/yii2-pjax (v2.0.5)
    Downloading: 100%

  - Installing bower-asset/punycode (v1.3.2)
    Downloading: 100%

  - Installing bower-asset/jquery.inputmask (3.2.7)
    Downloading: 100%

  - Installing cebe/markdown (1.1.0)
    Downloading: 100%

  - Installing yiisoft/yii2 (2.0.7)
    Downloading: 100%

  - Installing swiftmailer/swiftmailer (v5.4.1)
    Downloading: 100%

  - Installing yiisoft/yii2-swiftmailer (2.0.4)
    Downloading: 100%

  - Installing yiisoft/yii2-codeception (2.0.4)
    Downloading: 100%

  - Installing bower-asset/bootstrap (v3.3.5)
    Downloading: 100%

  - Installing yiisoft/yii2-bootstrap (2.0.5)
    Downloading: 100%

  - Installing yiisoft/yii2-debug (2.0.5)
    Downloading: 100%

  - Installing bower-asset/typeahead.js (v0.10.5)
    Downloading: 100%

  - Installing phpspec/php-diff (v1.0.2)
    Downloading: 100%

  - Installing yiisoft/yii2-gii (2.0.4)
    Downloading: 100%

  - Installing fzaninotto/faker (v1.5.0)
    Downloading: 100%

  - Installing yiisoft/yii2-faker (2.0.3)
    Downloading: 100%

Thank you, but it doesn't work for me, early this morning, Yii team release new stable version 2.0.7, and new guide on it: http://www.yiiframework.com/news/94/yii-2-0-7-is-released/ and here is the new guide: http://www.yiiframework.com/download/

To install the advanced application template, run the command below:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.7

I've tried the new one and it completed successfully.

@SilverFire

I had the same issue, solved running this command:
composer global require "fxp/composer-asset-plugin:^1.0"
before updating composer.json and running
composer update -o

I tried the same @thientc84 but it didn't worked for me. Same error as above. What can be the potentical cause?

Check out the solution suggested by @cebe in this comment

This helped me: sudo chown -R $USER $HOME/.composer

composer-cache file permissions #19 -> pgporada commented on 1 Oct 2015

What are the permissions on your /home/webadmin/.composer folder? I just installed composer to set up a dev environment for my team with the following line

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

and it set the permissions of the .composer/ folder in my home dir to

drwxr-xr-x    3 root        staff      102 Oct  1 10:50 .composer

Running this line will fix it.

sudo chown -R $USER $HOME/.composer

Updating yii to latest version helped me:
composer update yiisoft/yii2 yiisoft/yii2-composer bower-asset/jquery.inputmask

@lyhoshva ,thanks,it works as you say。

@nadirvishun , you are welcome.

Or https://github.com/cebe/assetfree-yii2

this one has all the release versions of yii2, so it is a transparent replacement.

neither of the above solution given by nice people helped me 👎

probably because the problem occured long time ago. open a new issue, or ask in other places if its not a framework bug:

Thank you for your question.
In order for this issue tracker to be effective, it should only contain bug reports and feature requests.

We advise you to use our community driven resources:

If you are confident that there is a bug in the framework, feel free to provide information on how to reproduce it. This issue will be closed for now.

_This is an automated comment, triggered by adding the label question._

Was this page helpful?
0 / 5 - 0 ratings