在composer上安装Yii composer资产插件

I am trying to install "fxp/composer-asset-plugin:^1.2.0" on windows 32bit composer but always failed. Here is the message

Installation failed, reverting ./composer.json to its original content.

[Composer\Downloader\TransportException]
Content-Length mismatch

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...

Anyone know what is the problem here? Please help Thank you

You should update composer at first with

composer selfupdate

And be sure, you installing "fxp/composer-asset-plugin" globally, like official install guide says:

composer global require "fxp/composer-asset-plugin:^1.2.0"

If you are using windows, try running composer from cmd "as Administator". To clarify, if you have access to global directory, run

composer global show -s

And check output directory manually