Skip to content

New 5.x version breaks Flex versions 1.5.2 and lower #691

Closed
@weaverryan

Description

@weaverryan
Member

Hi!

I'm not sure there is anything we can do about it, but due to the new 5.x on https://flex.symfony.com/versions.json, Flex is broken (no update or require options can be made) on versions 1.5.2 and lower. The fix is #580

On 1.5.2 or lower, depending on the exact command you're running and the exact version of Flex, you will probably get:

Uncaught Error: Call to a member function getVersions() on null in /Users/koff.pro/Downloads/code-messenger/start/vendor/symfony/flex/src/Cache.php

Or

Invalid version string "5.x"

The FIX

The fix is to upgrade symfony/flex with some flags to avoid it doing its normal job (which causes the error):

composer update symfony/flex --no-plugins --no-scripts

# or, if you have memory errors
COMPOSER_MEMORY_LIMIT=-1 composer update symfony/flex --no-plugins --no-scripts

Activity

stof

stof commented on Oct 8, 2020

@stof
Member

if you run with --no-plugins, I don't even think you need to first remove the vendor folder

nicolas-grekas

nicolas-grekas commented on Oct 8, 2020

@nicolas-grekas
Member

This is similar to #683
The fix has been released a few weeks ago already.
We cannot do better (but document of course, as done in this issue)

m-vo

m-vo commented on Oct 13, 2020

@m-vo

Just leaving this here in case someone stumbles over it: I had an installation with symfony/flex being installed globally. This then also broke creating projects with symfony new. Removing the global package resolves this of course but it might be not obvious what is causing the trouble.

added a commit that references this issue on Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @weaverryan@nicolas-grekas@stof@m-vo

        Issue actions

          New 5.x version breaks Flex versions 1.5.2 and lower · Issue #691 · symfony/flex