Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to correct the [Composer\Downloader\TransportException] error for composer

Good day people, I have been having this problem for days now, when I try to download dependencies for my php project using composer I get this error

c:\wamp64\www\Test>composer global require "fxp/composer-asset-plugin:^1.3.1"
Changed current directory to C:/Users/Nwachukwu Favour/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

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


  [Composer\Downloader\TransportException]
  The "http://packagist.org/p/provider-2014%241cf88bd0ed4076dc091407477ba2a76483e8598ee5365673381262e6c1d40fcf.jso
  n" file could not be downloaded: failed to open stream: HTTP request failed!


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

I am running a windows 10 OS and am suspecting that my system cannot download from the command line. I would be very glad if someone can help me solve this problem because it is hindering my project. Thanks in advance.

like image 734
CodeHealer Avatar asked May 16 '17 08:05

CodeHealer


People also ask

Why is my composer not working?

Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php -- --check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.

How do I update dependencies composer?

Updating dependencies to their latest versions# To update to the latest versions, use the update command. This will fetch the latest matching versions (according to your composer. json file) and update the lock file with the new versions.

How do I update composer Phar?

update / u# In order to get the latest versions of the dependencies and to update the composer. lock file, you should use the update command. This command is also aliased as upgrade as it does the same as upgrade does if you are thinking of apt-get or similar package managers.


1 Answers

You could also run this command on the CLI before installing any dependencies. It forces composer to use https to download all resources:

composer config -g repo.packagist composer https://packagist.org
like image 140
Udo E. Avatar answered Sep 21 '22 06:09

Udo E.