0

我有以下composer.json

{
    "name": "zendframework/skeleton-application",
    "description": "Skeleton Application for ZF2",
    "license": "BSD-3-Clause",
    "keywords": [
        "framework",
        "zf2"
    ],
    "homepage": "http://framework.zend.com/",
    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.2.*",
        "doctrine/doctrine-orm-module": "*",
        "bjyoungblood/bjy-authorize": "1.2.*",
        "zf-commons/zfc-user": "dev-master",
        "zendframework/zend-developer-tools": "*",
        "zendframework/zftool": "dev-master",
        "swiftmailer/swiftmailer" : "*",
        "mwillbanks/zfc-twitter-bootstrap": "*"
    }
}

在我添加了 require 后zf-commons/zfc-user-doctrine-orm,Composer 无法执行命令composer update并给出大错误消息:

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 zf-commons/zfc-user dev-master -> satisfiable by
zf-commons/zfc-user[dev-master].
- Conclusion: don't install zf-commons/zfc-user 0.1.2
- Conclusion: remove zendframework/zendframework 2.2.0
- zf-commons/zfc-user 0.0.1 requires zendframework/zendframework 2.0.* -> sa
tisfiable by zendframework/zendframework[2.0.0, 2.0.0rc1, 2.0.0rc2, 2.0.0rc3, 2.
0.0rc4, 2.0.0rc5, 2.0.0rc6, 2.0.0rc7, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6,
2.0.7, 2.0.8].
- zf-commons/zfc-user-doctrine-orm 0.0.1 requires zendframework/zendframewor
k 2.0.* -> satisfiable by zendframework/zendframework[2.0.0, 2.0.0rc1, 2.0.0rc2,
2.0.0rc3, 2.0.0rc4, 2.0.0rc5, 2.0.0rc6, 2.0.0rc7, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2
.0.5, 2.0.6, 2.0.7, 2.0.8].
- zf-commons/zfc-user 0.1.0 requires zendframework/zendframework 2.1.* -> sa
tisfiable by zendframework/zendframework[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.
5].
- zf-commons/zfc-user 0.1.1 requires zendframework/zend-view 2.1.* -> satisf
iable by zendframework/zendframework[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5],
zendframework/zend-view[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5].
- zf-commons/zfc-user-doctrine-orm 0.1.0 requires zendframework/zendframewor
k 2.1.* -> satisfiable by zendframework/zendframework[2.1.0, 2.1.1, 2.1.2, 2.1.3
, 2.1.4, 2.1.5].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc1].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc2].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc3].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc4].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc5].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc6].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.0rc7].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.1].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.2].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.3].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.4].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.5].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.6].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.7].
- Can only install one of: zendframework/zendframework[2.2.0, 2.0.8].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.0].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.1].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.2].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.3].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.4].
- Can only install one of: zendframework/zendframework[2.2.0, 2.1.5].
- don't install zendframework/zend-view 2.1.0|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.1|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.2|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.3|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.4|don't install zendframework/ze
ndframework 2.2.0
- don't install zendframework/zend-view 2.1.5|don't install zendframework/ze
ndframework 2.2.0
- Installation request for zendframework/zendframework == 2.2.0.0 -> satisfi
able by zendframework/zendframework[2.2.0].
- zf-commons/zfc-user-doctrine-orm 0.1.1 requires zf-commons/zfc-user 0.* ->
satisfiable by zf-commons/zfc-user[0.0.1, 0.1.0, 0.1.1, 0.1.2].
- Installation request for zf-commons/zfc-user-doctrine-orm * -> satisfiable
by zf-commons/zfc-user-doctrine-orm[0.0.1, 0.1.0, 0.1.1].

如何修复此错误消息?

4

3 回答 3

6

您的作曲家文件对我来说很好。这可能是因为您使用的是 dev-masterzf-commons/zfc-user而不是标记的版本号。

因为这个 Composer 正在使用 Composer 缓存中存在的旧版本,而不是下载新版本。您可以看出它使用的是 Composer 所指的旧版本,zf-commons/zfc-user 0.0.1但当前版本是 0.1.2。旧版本zf-commons/zfc-user依赖于旧版本,并且旧版本zendframework/zendframework与需要更新版本的其他模块发生冲突。

如果您更换:

"zf-commons/zfc-user": "dev-master",

和:

"zf-commons/zfc-user": "~0.1.2",

它应该强制 Composer 下载该模块的 0.1.2 或更新版本。

于 2013-07-10T00:16:16.767 回答
1

2015 年,这项工作对我来说很好

"zf-commons/zfc-user": "1.*",
"zf-commons/zfc-user-doctrine-orm": "^1.0"
于 2015-07-19T11:53:26.253 回答
0

我遇到了同样的问题,所以我将 dev-master 的一些依赖项更改为他们的最新版本并且它有效。我的 composer.json 文件:

{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
    "framework",
    "zf2"
],
"homepage": "http://framework.zend.com/",
"require": {
    "php": ">=5.5",
    "zendframework/zendframework": "~2.5",
    "zendframework/zftool": "dev-master",
    "doctrine/doctrine-orm-module": "^0.10.0",
    "zendframework/zend-developer-tools": "dev-master",
    "bjyoungblood/bjy-profiler": "dev-master",
    "doctrine/migrations": "^1.4",
    "doctrine/orm": "^2.5",
    "rradutzu/zend2-doctrine-dynamic-db": "^0.0.4",
    "zf-commons/zfc-rbac" : "~2.4",
    "zf-commons/zfc-user": "1.4.4",
    "zf-commons/zfc-user-doctrine-orm": "^1.0.1"
}

}

于 2016-06-28T12:05:27.750 回答