Skip to content

Installation of symfony/flex throw error "preg_match() expects parameter 2 to be string, object given" #759

@popovserhii

Description

@popovserhii

I tried to add symfony/flex to my project but this throws an exception. I tried to clear cache, remove vendor directory, remove composer.lock, also I tried different versions of Symfony 4.4, 5.1, 5.2 - the result is the same:

# composer require symfony/flex
Using version 1.12.x-dev for symfony/flex
./composer.json has been updated
Running composer update symfony/flex
Loading composer repositories with package information                                                                                                                             Updating dependencies                                 
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking symfony/flex (dev-main 9d71b2f)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing symfony/flex (dev-main 9d71b2f): Extracting archive
Plugin initialization failed (preg_match() expects parameter 2 to be string, object given), uninstalling plugin
  - Removing symfony/flex (dev-main 9d71b2f)
    Install of symfony/flex failed

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

                                                               
  [ErrorException]                                             
  preg_match() expects parameter 2 to be string, object given  
                                                               

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...

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

    Issue actions