加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 通过composer安装Yii2失败

发布时间:2020-12-13 21:58:51 所属栏目:PHP教程 来源:网络整理
导读:我想通过composer安装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.*
我想通过composer安装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.

我也安装了最新版本的composer-asset-plugin.
我清除了作曲家缓存并更新它.
但我无论如何都无法安装yii2-basic

这是我的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": "*"
    }
}

解决方法

由于Yii 2绑定到 fxp/composer-asset-plugin,您必须将fxp插件安装到您的composer环境中.必须全局安装fxp插件.您可以使用以下命令实现此目的:

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

成功安装fxp插件后,从composer.json中的require部分删除需求,然后再次运行composer update.

How to install FXP composer plugin Docs

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读