本文共 2536 字,大约阅读时间需要 8 分钟。
第一次使用composer ,因为yii项目必须要用到,然而·····
composer install / update 会报如下错误:
F:\xxx\www\yii_blog>composer install You are running composer with xdebug enabled. This has a major impact on runtime performance. Loading composer repositories with package informationInstalling dependencies (including require-dev) from lock file Warning: The lock file is not up to date with the latest changes in composer.jso n . You may be getting outdated dependencies. Run update to update them.Your requirements could not be resolved to an installable set of packages. - Installation request for fxp/composer-asset- plugin v1.0.0-beta4 -> satisfiable by fxp/composer-asset- plugin [v1.0.0-beta4]. - fxp/composer-asset- plugin v1.0.0-beta4 requires composer- plugin -api 1.0.0-> no matching package found. - Installation request for yiisoft/yii2-composer 2.0.3 -> satisfiable by yiisoft/yii2-composer[2.0.3]. - yiisoft/yii2-composer 2.0.3 requires composer- plugin -api 1.0.0 -> no match ing package found. - yiisoft/yii2-composer 2.0.3 requires composer- plugin -api 1.0.0 -> no match ing package found. - yiisoft/yii2 2.0.3 requires yiisoft/yii2-composer * -> satisfiable by yiisoft/yii2-composer[2.0.3]. - Installation request for yiisoft/yii2 2.0.3 -> satisfiable by yiisoft/yii2[2.0.3].Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your min imum-stability setting ``````````````````````````````````````````````````````````````````````````````````````````````````````````` 经过了一番的几小时的摸索,于是我开始了我的报错解决之道: 要么 ①下载composer.phar 要么②安装composer install.exe for windows Yii2 需要 composer-plugin-api 1.0
以上的版本 檢查 composer-asset-plugin
的版本或者查看一下有無安裝, 先確定有沒有或者有沒有超過1.0以上 如果都沒有的話使用 composer global require "fxp/composer-asset-plugin:~1.1.1"
去下載, [http://www.yiichina.com/topic/6216]
系统全局配置: 即将配置信息添加到 Composer 的全局配置文件 config.json 中。
composer config -g repo.packagist composer https://packagist.phpcomposer.com
[http://pkg.phpcomposer.com/]
安装fxp/composer-asset-plugin : composer require fxp/composer-asset-plugin 等待安装
fxp/composer-asset-plugin [https://packagist.org/packages/fxp/composer-asset-plugin ]