首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >尝试升级到Yii 2.0.15时出现Composer错误

尝试升级到Yii 2.0.15时出现Composer错误
EN

Stack Overflow用户
提问于 2018-06-10 04:51:50
回答 1查看 2.6K关注 0票数 1

我试着更新我的Yii,但我收到了这条消息:

代码语言:javascript
复制
[alexandre@Mac-mini-de-Alexandre:gestao_web (master)] php composer.phar require "yiisoft/yii2:~2.0.15" --update-with-dependencies
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for yidas/yii2-composer-bower-skip (locked at 2.0.12, required as ~2.0.0) -> satisfiable by yidas/yii2-composer-bower-skip[2.0.12].
- yiisoft/yii2 2.0.15 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> satisfiable by yidas/yii2-composer-bower-skip[2.0.13].
- yiisoft/yii2 2.0.15.1 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> satisfiable by yidas/yii2-composer-bower-skip[2.0.13].
- Conclusion: don't install yidas/yii2-composer-bower-skip 2.0.13
- Installation request for yiisoft/yii2 ~2.0.15 -> satisfiable by yiisoft/yii2[2.0.15, 2.0.15.1].
Installation failed, reverting ./composer.json to its original content.
[alexandre@Mac-mini-de-Alexandre:gestao_web (master)] ./yii
This is Yii version 2.0.12.2.

这是我的composer.json

代码语言:javascript
复制
{
    "name": "yiisoft/yii2-app-basic",
    "description": "Yii 2 Basic Application Template",
    "keywords": ["yii2", "framework", "basic", "application 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",
        "yidas/yii2-composer-bower-skip": "~2.0.0",
        "yiisoft/yii2": ">=2.0.7",        
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "2amigos/yii2-resource-manager-component": "*",
        "moonlandsoft/yii2-phpexcel": "*",
        "boundstate/yii2-mailgun": "*",
        "e96/yii2-mailgun-mailer": "*"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "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"
            ]
        },
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

我尝试将composer更改为:

代码语言:javascript
复制
"yiisoft/yii2": ">=2.0.12"

但我也犯了同样的错误。

有人知道这个问题可能是什么吗?我该怎么修复呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-10 05:34:49

在这种情况下,您可能需要一个--update-with-all-dependencies开关:

代码语言:javascript
复制
php composer.phar require "yiisoft/yii2:~2.0.15" --update-with-all-dependencies

除了作为根需求的包之外,

--update-with-dependencies:还更新新需要的包的依赖项。

--update-with-all-dependencies:还会更新新需要的包的依赖项,包括根需求包。

https://getcomposer.org/doc/03-cli.md#require

顺便说一句:你真的应该用真正的约束替换掉你composer.json中的所有那些* --每一个更新都可能破坏你的应用。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50778432

复制
相关文章

相似问题

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