目前,我的项目使用的是 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 版本,但这个命令的消息是:
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.
这是我的作曲家.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版本,我尝试搜索了很多次和页面,但没有解决方案:(
非常感谢。
您需要更改项目名称。根据你的composer.json
你的项目是yiisoft/yii2
的,这是不正确的。我不知道您是如何获得此composer.json
的,这是官方模板 - 您的应用程序结构和composer.json
应该看起来相似(或者您可以尝试高级模板)。更改包名称后,此命令应该可以解决问题:
composer require yiisoft/yii2-queue --update-with-all-dependencies