Edofre / yii2-fullcalendar

Yii 2 component for easy fullcalendar integration
MIT License
27 stars 9 forks source link

Install failed via composer #10

Closed phucnguyenvn closed 7 years ago

phucnguyenvn commented 7 years ago

Hi buddy,

I got this error when install via composer:

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

[UnexpectedValueException] Could not parse version constraint >=~2: Invalid version string "~2"**

Edofre commented 7 years ago

Would you mind sharing your composer.json file? I just tried to install it and managed to install without any problems.

phucnguyenvn commented 7 years ago

Hi @Edofre I tried to install with a fresh yii2-basic project and I got this error, below is my composer.json file:

{ "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", "macfly/yii2-oauth2-server": "*" }, "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"
    }
}

}

Edofre commented 7 years ago

My package required yii2 2.0.11. I've loosened the requirements a bit and the following composer.json is working for me on a yii2-app-basic install:

{
    "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": "dev",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "2.0.11",
        "yiisoft/yii2-bootstrap": "~2.0.0",
        "yiisoft/yii2-swiftmailer": "~2.0.0",
        "edofre/yii2-fullcalendar": "V1.0.8"
    },
    "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"
        }
    }
}
phucnguyenvn commented 7 years ago

I try install with the above composer.json Can you try with the fresh install of yii2-app-basic and also without any modify the composer.json? I make my module here https://github.com/phucnguyenvn/yii2-evecalendar but the install was failed due to this module.

Edofre commented 7 years ago

With the default yii2-app-basic composer.json it also installs now.

{
  "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": "dev",
  "require": {
    "php": ">=5.4.0",
    "yiisoft/yii2": "~2.0.5",
    "yiisoft/yii2-bootstrap": "~2.0.0",
    "yiisoft/yii2-swiftmailer": "~2.0.0",
    "edofre/yii2-fullcalendar": "V1.0.8"
  },
  "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"
    }
  }
}
unst commented 7 years ago

I have yiisoft/yii2-app-advanced installed and get the same error

Could not parse version constraint >=~2: Invalid version string "~2"

I install the newest composer-asset-plugin composer global require "fxp/composer-asset-plugin:dev-master"

and then I can install edofre/yii2-fullcalendar without any error

Edofre commented 7 years ago

What composer version are you using? I'm on Composer version 1.3.2.

Just tried the following commands, and the package installed without any problems..

composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-advanced-application
cd yii-advanced-application
composer require edofre/yii2-fullcalendar "V1.0.8"

Waiting for each command to finish of course.

unst commented 7 years ago

My composer version is Composer version 1.3.0 2016-12-24 00:47:03

Edofre commented 7 years ago

@unst And if you update composer? Do you still get the message?

https://getcomposer.org/doc/03-cli.md#self-update

Sorry, I read that wrong, thanks for confirming that the install was working :)

unst commented 7 years ago

Oh, no problem. Thank you