2016-09-04 258 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