UnexpectedValueException:无法解析版本约束> = ~2:无效的版本字符串“~2”

时间:2017-02-17 16:15:26

标签: yii2 composer-php

我试过了:

  1. 作曲家全球更新

  2. composer selfupdate

  3. 作曲家更新

  4. 我在第3步遇到错误。

    我运行php 7.使用Yii2构建网页。 我过去成功运行过“作曲家更新”(我记得,那是在将php更新为7之前)

    下面是我的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": "dev",
        "require": {
            "php": ">=5.3.3",
            "yiisoft/yii2": "*",
            "yiisoft/yii2-authclient": "*",
            "yiisoft/yii2-bootstrap": "*",
            "yiisoft/yii2-swiftmailer": "*",
            "kartik-v/yii2-widget-datetimepicker": "*",
            "kartik-v/yii2-widget-select2": "@dev",
            "dektrium/yii2-user": "*",
            "philippfrenzel/yii2fullcalendar": "*",
            "kartik-v/yii2-widget-timepicker": "*",
            "kartik-v/yii2-widget-depdrop": "@dev",
            "wbraganca/yii2-dynamicform": "*",
            "kartik-v/yii2-widgets": "*",
            "kartik-v/yii2-grid": "@dev",
            "kartik-v/yii2-mpdf": "dev-master",
            "kartik-v/yii2-popover-x": "*",
            "kartik-v/yii2-krajee-base": "dev-master",
            "bluezed/yii2-scroll-top": "*",
            "kartik-v/yii2-icons": "@dev",
            "kartik-v/yii2-export": "*",
            "kartik-v/yii2-field-range": "*",
            "kartik-v/yii2-widget-typeahead": "*",
            "fxp/composer-asset-plugin": "*",
            "ext-gd": "*",
            "codemix/yii2-streamlog": "^1.0",
            "ext-intl": "*",
            "yii2mod/yii2-google-maps-markers": "*",
            "kartik-v/yii2-tabs-x": "*",
            "kartik-v/yii2-editable": "*",
            "kartik-v/yii2-money": "dev-master",
            "yiisoft/yii2-imagine": "*",
            "himiklab/yii2-recaptcha-widget": "*",
            "aws/aws-sdk-php": "^3.20",
            "aws/aws-php-sns-message-validator": "^1.1",
            "doctrine/cache": "^1.6",
            "fedemotta/yii2-aws-sdk": "*",
            "loveorigami/yii2-notification-wrapper": "*",
            "bower-asset/noty": "^2.3",
            "bower-asset/jquery-growl": "^1.3"
        },
        "require-dev": {
            "yiisoft/yii2-codeception": "*",
            "yiisoft/yii2-debug": "*",
            "yiisoft/yii2-gii": "*",
            "yiisoft/yii2-faker": "*"
        },
        "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"
            }
        }
    }
    

    谢谢。

1 个答案:

答案 0 :(得分:7)

"philippfrenzel/yii2fullcalendar": "*"存在错误 您可以使用composer update -vvv

检查此错误

您可以在此处看到:https://github.com/philippfrenzel/yii2fullcalendar/issues/76

使用它来临时解决:

$ composer global require fxp/composer-asset-plugin:~1.3@dev

如果在尝试执行与此类似的编写器时出现另一个错误,则执行此操作:

Changed current directory to /Users/xxxx/.composer

Fatal error: Call to undefined method Composer\Package\RootPackage::getConfig() in /Users/xxxx/.composer/vendor/fxp/composer-asset-plugin/Util/Config.php on line 125

要解决此问题,您只需删除文件夹:sudo rm -rf /Users/xxxx/.composer