2016-09-04 190 views
3

我想通過作曲家安裝yii2和它給我一個錯誤通過作曲家安裝Yii2失敗

這裏是錯誤:

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

    Problem 1 
    - 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. 
    - yiisoft/yii2 2.0.8 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> 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. 
    - yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. 
    - Installation request for yiisoft/yii2 >=2.0.5 -> satisfiable by yiisoft/yii2[2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9]. 

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. 

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. 

還我安裝了最新版本的作曲家資產插件。 我清除了作曲家緩存並更新它。 但我不能安裝yii2,基本反正

這是我composer.json

{ 
    "require": { 
     "phpunit/phpunit": "*", 
     "phpunit/phpunit-selenium": "*", 
     "phpunit/php-invoker": "^1.1", 
     "phpunit/dbunit" : "^2.0", 
     "fxp/composer-asset-plugin": "^1.2.0" 
    }, 
    "minimum-stablility‬‬": "dev", 
    "repositories": [ 
     { 
      "type": "vcs", 
      "url": "https://github.com/Codeception/YiiBridge", 
      "reference": "origin/master" 
     } 
    ], 
    "require-dev": { 
     "codeception/codeception": "2.2.2", 
     "codeception/YiiBridge": "dev-master", 
     "flow/jsonpath": "*" 
    } 
} 
+0

重新啓動您的系統! –

+0

試運行作曲家自我更新 –

+1

變化'「最低stablility」:「開發」''以「最低stablility」:「穩定」' –

回答

6

由於Yii的2綁定到fxp/composer-asset-plugin您必須將FXP插件安裝到您的作曲家環境。 fxp插件必須全球安裝。你可以用下面的命令實現這一點:

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

後,FXP插件的安裝sucessfull從需要在composer.json節中刪除的要求,再次運行composer update

How to install FXP composer plugin Docs

+0

Yii2將有望與2.1版,因爲我可以放下FXP插件要求請閱讀wiki中的[下一個主要版本計劃](https://github.com/yiisoft/yii2/wiki/Plan-for-next-major-versions#client-side)。 – nadar

+0

我們也可以在本地安裝'php composer.phar require「fxp/composer-asset-plugin:〜1.2.2」'。順便說一句謝謝 –

0

我有同樣的問題,當我運行composer update

我解決它通過安裝命令,而不是更新

composer install 

您也可以嘗試在第一

composer self-update 
更新作曲家
0

更改最小stablility"minimum-stablility‬‬": "stable"因爲一些您的包裹要安裝沒有dev版本,也可以安裝yii2使用默認安裝命令

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

,一旦安裝,就可以安裝包一前一後下面的命令

php composer.phar require packageName

0

你可以嘗試yii2-bower-asset不使用fxp/composer-asset-plugin安裝鮑爾爲Yii2。

該包具有固定爲鮑爾Yii2,其分離鮑爾和作曲家。

https://github.com/yidas/yii2-bower-asset


順便說一句,Yii的2.1將使用資產Packagist溶液代替fxp/composer-asset-plugin