Search code examples
yiicomposer-phpyii2travis-cipackagist

Travis.ci: "composer requirements could not be resolved" but everything works locally (Yii2)


I'm building a package for Yii2 Framework.

Locally everything works just fine: tests are green, composer installs / updates dependencies with no problems (I've tried on several machines with different development environments and no problems at all).

But when travis-ci tries to build my project, the same composer command returns an error: "Your requirements could not be resolved to an installable set of packages".

Problem 1
    - yiisoft/yii2 2.0.4 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.3 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.2 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
    - Installation request for yiisoft/yii2 2.0.* -> satisfiable by yiisoft/yii2[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4].
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://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Here're my composer.json requirements:

"require": {
    "php": ">=5.4.0",
    "mobileka/scope-applicator": "1.0.*",
    "yiisoft/yii2": "2.0.*"
},
"require-dev": {
    "phpunit/phpunit": "4.1.*",
    "mockery/mockery": "0.9.3",
    "satooshi/php-coveralls": "0.6.1"
},

Let me repeat: this works locally and even other people have tried to clone my repository and everything worked just fine.

You can try yourself: https://github.com/mobileka/scope-applicator-yii2

git clone [email protected]:mobileka/scope-applicator-yii2.git && cd scope-applicator-yii2 && composer install.

Have anybody else faced this problem and is there a solution?

Thank you.


Solution

  • The problem was solved by modifying the .travis.yml file:

    before_script:
      - composer self-update
      - composer global require "fxp/composer-asset-plugin:~1.0.0"
      - composer install --prefer-source --no-interaction
    

    It was lacking a global requirement "fxp/composer-asset-plugin:~1.0.0".