0

Friends, when trying to run the

composer update

the following error appears:

C:\wamp\www\mysystem>composer update Loading composer repositories with package information Updating dependencies (including require-dev)

[UnexpectedValueException] Could not parse version constraint

=~2: Invalid version string "~2"

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no -suggest] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--p refer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [

]...

Here is my composer.json file:

{
    "license": "BSD-3-Clause",
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": ">=2.0.5",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "fxp/composer-asset-plugin": "~1.1.1",       
        "trntv/yii2-datetime-widget": "*",
        "miloschuman/yii2-highcharts-widget": "dev-master",
        "kartik-v/yii2-money": "*",
        "kartik-v/yii2-slider": "*",
        "kartik-v/yii2-widget-datepicker": "@dev",
        "kartik-v/yii2-field-range": "*",
        "kartik-v/yii2-widget-colorinput": "*",
        "kartik-v/yii2-widget-sidenav": "@dev",
        "kartik-v/yii2-export": "@dev",
        "kartik-v/yii2-grid": "@dev",
        "yiidoc/yii2-redactor": "*",
        "tugmaks/yii2-google-maps": "dev-master",
        "yiisoft/yii2-imagine": "^2.0",
        "karpoff/yii2-crop-image-upload": "*",
        "cyneek/yii2-menu": "dev-master",
        "bupy7/yii2-widget-cropbox": "*",
        "philippfrenzel/yii2fullcalendar": "*",
        "kartik-v/yii2-widget-touchspin": "*"
    },
    "require-dev": {
        "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"
        }
    }
}

I tried on w7 and ubuntu

1 Answer 1

3

Try to set old version fxp/composer-asset-plugin:

composer global require "fxp/composer-asset-plugin:1.0.1"

or install the newest one:

composer global require "fxp/composer-asset-plugin:dev-master"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.