3
votes

After installing composer I check it with this command:

composer diagnose

And all things are OK. When I run this command for latest version of Laravel:

composer global require "laravel/installer"

I get error:

[Composer\Downloader\TransportException] The "http://packagist.org/p/provider-2017-01%24b61fc29958261afed83292382737d143f41e535c0e562e62e6aaf5bf30978746.json" file could not be downloaded: failed to open stream: HTTP request failed!

Or for this command:

composer create-project --prefer-dist laravel/laravel proj

I get error:

[Composer\Downloader\TransportException] Content-Length mismatch, received 313522 bytes out of the expected 2060799

I checked Composer Content-Length Mismatch but this didn't resolve my problem. I tried using a VPN but the issue persists.

What is the problem and how I can resolve it?

solved my problem today (11/19/2017) without any change in config. i think that problem is in packagist.org or is in my isp. thanks

1
Try running sudo composer self-update and then try again - Option
try it but not working. You are already using composer version 1.5.2 (stable channel). - Mohammad
Possible duplicate of Composer Content-Length Mismatch - Option
Check the possible duplicate Mohammad. - Option

1 Answers

1
votes

I also had this problem and using VPN solved my problem.