目前,我的项目使用的是Yii 2.0.12版本。但我想使用扩展yiisoft/yii-queue。当我运行composer require yiisoft/yii-queue命令来安装这个扩展时,这个抛出的消息要求将Yii版本更新到2.0.14才能使用yiisoft/yii-queue。
因此,我运行命令composer require "yiisoft/yii2:~2.0.14" --update-with-all-dependencies来更新Yii版本,但是该命令的met消息是:
Problem 1
- Can only install one of: yiisoft/yii2[2.0.14, dev-master].
- Can only install one of: yiisoft/yii2[2.0.14.1, dev-master].
- Can only install one of: yiisoft/yii2[2.0.14.2, dev-master].
- Can only install one of: yiisoft/yii2[2.0.15, dev-master].
- Can only install one of: yiisoft/yii2[2.0.15.1, dev-master].
- Installation request for yiisoft/yii2 dev-master -> satisfiable by yiisoft/yii2[dev-master].
- Installation request for yiisoft/yii2 ~2.0.14 -> satisfiable by yiisoft/yii2[2.0.14, 2.0.14.1, 2.0.14.2, 2.0.15, 2.0.15.1].
Installation failed, reverting ./composer.json to its original content.这是我的composer.json
{
"name": "yiisoft/yii2",
"description": "Yii 2 Advanced Project Template",
"keywords": ["yii2", "framework", "advanced", "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.6.0",
"yiisoft/yii2": ">=2.0.6",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"yiisoft/yii2-authclient": "*",
"zhelyabuzhsky/yii2-sitemap": "*",
"phpoffice/phpexcel":"*",
"intervention/image": "^2.1",
"facebook/graph-sdk": "^5.7",
"vlucas/phpdotenv": "^3.1",
"trntv/probe": "^1.0",
"philippfrenzel/yii2fullcalendar": "^3.9"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"scripts": {
"post-install-cmd": "php init --env=Development --overwrite=n"
}
}有人帮我升级yii版本吗?在这种情况下,我尝试了很多次和页面搜索,但都没有解决方案:
非常感谢。
发布于 2019-01-20 20:45:00
您需要更改项目名称。根据你的composer.json,你的项目是yiisoft/yii2,这不是真的。我不知道你是怎么得到这个composer.json,here is the official template的--你的应用程序结构和composer.json应该看起来很相似(或者你可以试试advanced template)。更改包名称后,此命令应能完成此操作:
composer require yiisoft/yii2-queue --update-with-all-dependencieshttps://stackoverflow.com/questions/54273800
复制相似问题