0

I am trying to download Laravel but composer is showing error and stop the installation process after taking much time. I am quoting the exact error,

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

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [] [] []

How can I fix this error and start working on Laravel!

UPDATE - I have made the following changes in config.json file.

 {
  "config": {
    "github-protocols": [
      "https"
    ]
  },
  "repositories": {
    "packagist.org": {
      "type": "composer",
      "url": "https://packagist.org"
    }
  }
}

But then, it also not working!

  • 1
    Related question: https://stackoverflow.com/questions/38635257/composer-content-length-mismatch – twodee May 19 '18 at 16:20

1 Answers1

-1

your "repositories" key in composer.json should be like this:

"repositories" : [
  {
    "type": "composer",
    "url": "https://packagist.org"
  },
  {
    "packagist": false
  }
]
Udo E.
  • 2,665
  • 2
  • 21
  • 33
  • This was suggested by a contributor to the composer project on github here https://github.com/composer/composer/issues/5656. Plus, it worked flawlessly for me when i had same issue. – Udo E. Jun 25 '19 at 12:10