在安装好composr后使用命令
Code:
composer global require "laravel/installer"
出现了一下报错结果
Code:
Changed current directory to C:/Users/myname/AppData/Roaming/Composer

  [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] [--] [<packages>]...
意思就是错了呗翻译是内容长度不匹配。具体原因不得而知,但是找到了反推原因应该就是由于使用国外资源导致下载不下来。

解觉办法是使用命令:
Code:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
将composer的资源定位为国内镜像,使用国内镜像下载。
然后在使用命令
Code:
composer global require "laravel/installer"
安装便成功了。