Z
Z
Zohei2015-01-08 02:07:16
Yii
Zohei, 2015-01-08 02:07:16

How to install yii 2.0.1 via composer?

Hey!
Can't install yii2 via composer.
If you write "yiisoft/yii2": "*", then everything is set except for the framework itself... if you directly specify the version, then it swears that the package was not found....

composer require --prefer-dist "yiisoft/yii2 2.0.1"
./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
    - The requested package yiisoft/yii2 1.0.0 could not be found.

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.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.

{
    "name": "yiisoft/yii2",
    "description": "Yii PHP Framework Version 2",
    "keywords": ["yii2", "framework"],
    "homepage": "http://www.yiiframework.com/",
    "type": "library",
    "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": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "yiisoft/yii2-redis": "*",
        "yiisoft/yii2-composer": "*",
        "yiisoft/yii2-bootstrap": "@stable",
        "yiisoft/yii2-jui": "@stable",
        "cebe/markdown": "~1.0.0",
        "ezyang/htmlpurifier": "4.6.*",
        "bower-asset/jquery": "@stable",
        "bower-asset/jquery-ui": "@stable",
        "bower-asset/jquery.inputmask": "@stable",
        "bower-asset/typeahead.js": "0.10.*",
        "bower-asset/punycode": "@stable",
        "bower-asset/bootstrap": "@stable",
        "bower-asset/yii2-pjax": "@stable"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

UPD before writing here, of course, I:
1. put the plugin php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta4"
on jquery does not swear, it was installed normally.
2. did selfupdate. Composer latest version
Manually downloading the framework is also an option, but I want to figure out how to work with the newfangled composer that everyone praises so much, otherwise I only have one problem with it so far)
UPD2 it is curious that yii2 is missing in the .lock file.... (with entries "yiisoft/yii2": "*")

Answer the question

In order to leave comments, you need to log in

6 answer(s)
Z
Zohei, 2015-01-08
@Zohei

the problem was solved by removing these lines from composer.json, which were copied from yii2-app-basic and everything was installed!

"name": "yiisoft/yii2",
    "description": "Yii PHP Framework Version 2",
    "keywords": ["yii2", "framework"],
    "homepage": "http://www.yiiframework.com/",
    "type": "library",
    "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",

M
Maxim, 2015-01-08
@maxloyko

Klats

E
Eugene, 2015-01-08
@Nc_Soft

This garbage must be set
php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta4"
then yiisoft/yii2
In general, I still don't understand the logic of the developers, I install the PHP framework, and he tells me on JQUERY swears.

A
Anton, 2015-01-08
@Yadalay

They helped me recently. Maybe this will help you - How to install yii 2 on openserver?

P
phpnt, 2015-03-06
@phpnt

Installing Yii2 Framework on Windows.

I
Igor Vasiliev, 2017-09-14
@Isolution666

Hello.
Composer clearly told you, look at https://groups.google.com/d/topic/composer-dev/_g3... here it was necessary to install in composer.json
And he also said to look at getcomposer.org/doc/articles/troubleshooting .md
to solve further common problems.
The documentation on the composer site is in English, but you can translate via google translator.
Install failed, reverting ./composer.json to original content.
Something was not installed correctly, or one composer was installed on top of another, no one reads that openserver already has composer and then:
I mean , they write tips for you, read them, so I solved my problems with composer how everything is arranged, so I learned how to install widgets from github manually)) So of course it's better not to do it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question