首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Yii2 bower错误

Yii2 bower错误
EN

Stack Overflow用户
提问于 2018-07-20 19:02:39
回答 1查看 1.3K关注 0票数 2

我正在使用php yii2框架,当我想要安装一个组件时,我得到了以下错误:

代码语言:javascript
复制
composer require codemix / yii2-excelexport

错误:

代码语言:javascript
复制
Using version ^ 2.7 for codemix / yii2-excelexport
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
The "https://bower.herokuapp.com/packages/jquery" file could not be downloaded (HTTP / 1.1 502 Bad Gateway)
https://bower.herokuapp.com/packages could not be fully loaded, package information was loaded from the local cache and may be out of date
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: do not install yiisoft / yii2 2.0.15.1
    - Conclusion: do not install yiisoft / yii2 2.0.15
    - Conclusion: do not install yiisoft / yii2 2.0.14.2
    - Conclusion: do not install yiisoft / yii2 2.0.14.1
    - Conclusion: do not install yiisoft / yii2 2.0.14
    - Conclusion: do not install yiisoft / yii2 2.0.13.3
    - Conclusion: do not install yiisoft / yii2 2.0.13.2
    - Installation request for yiisoft / yii2 (locked at 2.0.12, required as ~ 2.0.5) -> satisfiable by yiisoft / yii2 [2.0.12].
    - Conclusion: do not install yiisoft / yii2 2.0.13.1
    - yii2tech / spreadsheet 1.0.0 requires yiisoft / yii2 ~ 2.0.13 -> satisfiable by yiisoft / yii2 [2.0.13, 2.0.13.1, 2.0.13.2, 2.0.13.3, 2.0.14, 2.0.14.1, 2.0.14.2 , 2.0.15, 2.0.15.1].
    - yii2tech / spreadsheet 1.0.1 requires yiisoft / yii2 ~ 2.0.13 -> satisfiable by yiisoft / yii2 [2.0.13, 2.0.13.1, 2.0.13.2, 2.0.13.3, 2.0.14, 2.0.14.1, 2.0.14.2 , 2.0.15, 2.0.15.1].
    - yii2tech / spreadsheet 1.0.2 requires yiisoft / yii2 ~ 2.0.13 -> satisfiable by yiisoft / yii2 [2.0.13, 2.0.13.1, 2.0.13.2, 2.0.13.3, 2.0.14, 2.0.14.1, 2.0.14.2 , 2.0.15, 2.0.15.1].
    - Conclusion: do not install yiisoft / yii2 2.0.13
    - Installation request for yii2tech / spreadsheet ^ 1.0 -> satisfiable by yii2tech / spreadsheet [1.0.0, 1.0.1, 1.0.2].


Installation failed, reverting ./composer.json to its original content.

我读到您必须在.bowerrc文件中添加以下行

代码语言:javascript
复制
{
      "directory": "vendor / bower",
      "timeout": 120000,
"registry": {
"search": [
"http: // localhost: 8000",
"https://registry.bower.io"
]
}
}

composer.json

代码语言:javascript
复制
{
    "name": "yiisoft/yii2-app-basic",
    "description": "Yii 2 Basic Project Template",
    "keywords": ["yii2", "framework", "basic", "project template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "~2.0.5",
        "yiisoft/yii2-bootstrap": "~2.0.0",
        "yiisoft/yii2-swiftmailer": "~2.0.0",
        "kartik-v/yii2-widget-select2": "@dev",
        "sammaye/yii2-audittrail": "^1.2",
        "kartik-v/yii2-export": "@dev",
        "ruskid/yii2-csv-importer": "dev-master",
        "moonlandsoft/yii2-phpexcel": "*",
        "wbraganca/yii2-dynamicform": "dev-master",
        "rmrevin/yii2-fontawesome": "~2.17",
        "yiisoft/yii2-jui": "^2.0@dev",
        "kartik-v/yii2-mpdf": "*",
        "kalyabin/yii2-select-google-map-location": "*",
        "kartik-v/yii2-widget-datetimepicker": "*"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "~2.0.0",
        "yiisoft/yii2-gii": "~2.0.0",
        "yiisoft/yii2-faker": "~2.0.0",

        "codeception/base": "^2.2.3",
        "codeception/verify": "~0.3.1",
        "codeception/specify": "~0.4.3"
    },
    "config": {
        "process-timeout": 1800,
        "fxp-asset":{
            "installer-paths": {
                "npm-asset-library": "vendor/npm",
                "bower-asset-library": "vendor/bower"
            }
        }
    },
    "scripts": {
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ],
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        }
    }
}

我这么做了,但没有解决问题。有人能帮我吗?

您需要更多信息来帮助我检测问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-07-20 19:48:35

codemix/yii2-excelexport需要比您已安装的版本更新的Yii。您需要使用--update-with-all-dependencies开关运行require

代码语言:javascript
复制
composer require codemix/yii2-excelexport --update-with-all-dependencies

bower警告可能与安装失败无关。但您应该将fxp/composer-asset-plugin更新到最新版本,以消除此警告:

代码语言:javascript
复制
composer global require "fxp/composer-asset-plugin:~1.4.4"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51441090

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档