研究Yii,按官方文档使用Composer安装Yii时,执行命令: viagra cialis levitra buy online

composer global require "fxp/composer-asset-plugin:~1.0.0"

出现以下错误:

C:\Users\JMJ>composer global require "fxp/composer-asset-plugin:~1.0.0"
Changed current directory to C:/Users/JMJ/AppData/Roaming/Composer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing fxp/composer-asset-plugin (v1.0.3)
    Downloading: 100%

Deprecation Notice: The Composer\Package\LinkConstraint\MultiConstraint class is deprecated, use Composer\Semver\Constraint\MultiConstraint instead. in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/LinkConstraint/MultiConstraint.php:17
Deprecation Notice: The Composer\Package\LinkConstraint\LinkConstraintInterface interface is deprecated, use Composer\Semver\Constraint\ConstraintInterface instead. in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/LinkConstraint/LinkConstraintInterface.php:17
Plugin installation failed, rolling back
  - Removing fxp/composer-asset-plugin (v1.0.3)

Installation failed, deleting ./composer.json.


  [ReflectionException]
  Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist



  [ErrorException]
  Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository::whatProvides() should be compatible wi
  th Composer\Repository\ComposerRepository::whatProvides(Composer\DependencyResolver\Pool $pool, $name, $bypassFilte
  rs = false)


require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]...

解决方法:

更换到最新版本即可:

composer global require "fxp/composer-asset-plugin:~1.1"

另外Composer最好也是最新版,命令: