报错内容如下:
The "fxp/composer-asset-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match
your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "fxp/composer-asset-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0"
) that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins"
option.
问题:
使用composer安装yii2框架时,按照文档说明进行composer更新(1.8 =》2.0),结果执行安装时报了上面的错误。执行composer --version 时也会有类似上面的提示。
解决:
重新安装回1.的版本,之后再执行composer安装yii2的命令未报错。(但等待时间太长)
详细操作见文档:https://getcomposer.org/doc/00-intro.md
我是在本地Windows环境遇到的该问题(其他操作系统解决方案见链接)。
Windows:
手动安装(cmd)
下载好自己所需版本的composer.phar(https://getcomposer.org/download/)
切到PHP安装目录下(php.exe文件所在地址)
将 composer.phar 复制到 PHP 的安装目录下面
执行 :echo @php “%~dp0composer.phar” %>composer.bat
新窗口执行 composer --version看是否正常。