简体   繁体   English

使用composer给出错误的Yii2安装

[英]Yii2 installation using composer giving error

I am trying to install Yii2 alpha. 我正在尝试安装Yii2 alpha。 When I run the following command after downloading composer and adding 下载composer并添加后运行以下命令时

"minimum-stability": "dev"

to composer.json. 到composer.json。

$ php composer.phar require yiisoft/yii2-framework "*"

I get the following error. 我收到以下错误。

Problem 1 - The requested package minimum-stability could not be found in any version, there may be a typo in the package name. 问题1 - 在任何版本中都找不到请求的包最小稳定性,包名中可能存在拼写错误。

Problem 2 - The requested package yiisoft/yii2-composer could not be found in any version, there may be a typo in the package name. 问题2 - 在任何版本中找不到所请求的包yiisoft / yii2-composer,包名中可能存在拼写错误。

Problem 3 - The requested package yiisoft/yii2-framework could not be found in any version, there may be a typo in the package name. 问题3 - 在任何版本中找不到所请求的包yiisoft / yii2-framework,包名中可能有拼写错误。

Potential causes : - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details. 可能的原因 : - 包裹名称中的拼写错误 - 根据您的最低稳定性设置,包裹在稳定版本中不可用,请参阅https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/讨论更多细节。

Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems. 阅读http://getcomposer.org/doc/articles/troubleshooting.md以了解更多常见问题。

Please help me. 请帮我。

start with 从...开始

php composer.phar init 

and set Minimum Stability[] to dev 并将最小稳定度[]设置为dev

then 然后

php composer.phar require yiisoft/yii2 "*"

Here is working composer.json code 这是有效的composer.json代码

{
    "name": "yiisoft/yii2-app-advanced",
    ...
    "minimum-stability": "dev",
    "require": {
            "php": ">=5.4.0",
            "yiisoft/yii2": "*",
    },
    "require-dev": {
            "yiisoft/yii2-debug": "*",
            "yiisoft/yii2-gii": "*"
    },
    ...
}

Use yii2 against yii2-framework, may be you typed "minimum-stability" in the wrong place. 对yii2-framework使用yii2,可能是你在错误的地方键入“最小稳定性”。 And you don't need type yii2-composer there, it will be installed automatically 而且你不需要在那里输入yii2-composer,它会自动安装

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM