Fatal error while using composer 2.2.5
The error is as follows:
Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::isTtySupported() in /Users/danpock/GitProjects/kickflip-src/vendor/ramsey/devtools-lib/src/Composer/Command/ProcessCommand.php:68
Seems to be from: https://github.com/ramsey/devtools-lib/blob/ea4205cc4fb3b68126977deff59742ede8105c90/src/Composer/Command/ProcessCommand.php#L68
Thanks! I know what's causing it, and I'm working on a solution.
It's because the version of symfony/console that Composer uses internally is not the same version that the project uses.
Related:
- https://github.com/ramsey/composer-repl/issues/3
- https://github.com/ramsey/composer-plugin-issue/issues/1
- https://github.com/composer/composer/issues/8907
hmm. just trying to consider why it only broke my CI stuff recently. ultimately just wondering if there's an easy mitigation to it. 🤔
Probably because I released 1.4.0 recently, which has this bug in it, and your CI environment grabbed the latest version. The quickest way to mitigate it (which is what I've had to do) is to use (or add) the following in your composer.json:
"ramsey/devtools-lib": "1.3.0"
This will lock your project to use 1.3.0, which works.
I'll try to have this fix later this week.
Composer prior 2.3 uses symfony/console 3.4. The isTtySupported() method is really simple. Why do not copy&paste it to the devtool? It would be fast fix.
I've just released a version 2.0 that should fix this issue (by raising the minimum supported versions).