Flex: Cant update

Created on 5 Aug 2018  路  9Comments  路  Source: symfony/flex

Hi,

I'm trying to update(composer update) my project, but I'm getting this error:

 [ErrorException]                                                             
  Declaration of Symfony\Flex\ParallelDownloader::getRemoteContents($originUr  
  l, $fileUrl, $context) should be compatible with Composer\Util\RemoteFilesy  
  stem::getRemoteContents($originUrl, $fileUrl, $context, ?array &$responseHe  
  aders = NULL)

Most helpful comment

You can try composer update symfony/flex --no-plugins --no-scripts.
Then try composer install.

Can you show us the scripts part of your composer.json?

All 9 comments

Looks like you need to update Flex first: composer update symfony/flex --no-plugins

When i try this: composer update symfony/flex --no-plugins before installing my dependencies then i get this error:

composer update symfony/flex --no-plugins
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 63 updates, 0 removals
 - Updating symfony/flex (v1.0.80 => v1.0.89)

...

Writing lock file
Generating autoload files
> symfony-cmd
sh: 1: symfony-cmd: not found
Script symfony-cmd handling the auto-scripts event returned with error code 127
Script @auto-scripts was called via post-update-cmd
The command "composer update symfony/flex --no-plugins" failed and exited with 127 during .
Your build has been stopped.

You can try composer update symfony/flex --no-plugins --no-scripts.
Then try composer install.

Can you show us the scripts part of your composer.json?

Why did i not try this myself before..
It worked with --no-scripts thanks!

@B-Galati Marvelous! Thanks.

While resurrecting my PHP playground after nearly 18 months in Node/TypeScript land, I had to resort to 2GB to get past this...

php -d memory_limit=2G /usr/local/bin/composer update symfony/flex --no-plugins --no-scripts

That's a lot of memory for a composer update!

But you disabled plugins, so don't expect flex to be involved in any way!

I concur, but I closed my terminal now so can't double check history easily. I think there were two things in play, the incompatible signature thing and a memory limit thing. I may have lost track of exactly which it was in the end due to going to the bar in our hotel for a while :-)

In the end I only needed to increase the PHP memory limit in my PHP container to 256GB to get composer install to behave. It took a while to work through a load of other things that seemed to be feeding into the general malaise, but that's my fault for leaving a PR on a personal project to go stale for about 18 months because I was working in a great place and got all my code fun at work :-)

Was this page helpful?
0 / 5 - 0 ratings