【发布时间】:2017-11-07 05:43:06
【问题描述】:
我已经在本地机器上成功设置了 Yii2。我当前的 Yii 版本是 2.0.11.2。我想在我的项目中使用钩子。在这里,我运行了 composer 命令来安装钩子。但是无法安装。
composer require --prefer-dist yiike/yii2-hook "*"
错误:
C:\xampp\htdocs\yii2>composer require --prefer-dist yiike/yii2-hook "*"
./composer.json has been updated
The "extra.asset-installer-paths" option is deprecated, use the "config.fxp-asse
t.installer-paths" option
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
- The requested package yiike/yii2-hook * is satisfiable by yiike/yii2-hook[
dev-master] but these conflict with your requirements or minimum-stability.
Installation failed, reverting ./composer.json to its original content.
C:\xampp\htdocs\yii2>
我正在关注这个文档:https://packagist.org/packages/yiike/yii2-hook(文档中显然没有提到)
或者,我在 composer.json 中添加了"yiike/yii2-hook": "*",然后更新 composer.json 文件。但是同样的错误来了。
你能帮帮我吗
编辑:
{
"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",
"yiike/yii2-hook": "*"
},
"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
},
"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.json的最低稳定性添加到问题中 -
@SmartCoder 我已经编辑了我的问题。请你检查一下。 :)