朋友,在尝试运行
时作曲家更新
出现以下错误:
C:\ wamp \ www \ mysystem> composer update加载composer存储库 包信息更新依赖项(包括require-dev)
[UnexpectedValueException]无法解析版本约束
= ~2:版本字符串无效" ~2"
更新[--prefer-source] [--prefer-dist] [ - dr-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] [ - ] [
] ...
这是我的composer.json文件:
{
"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"
}
}
}
我试过w7和ubuntu
答案 0 :(得分:3)
尝试设置旧版本fxp/composer-asset-plugin
:
composer global require "fxp/composer-asset-plugin:1.0.1"
或安装最新版本:
composer global require "fxp/composer-asset-plugin:dev-master"