How to manage updated Composer inside Laravel

I have tried to execute a command (locally) but an error occurs.
How to avoid this error?

composer self-update --2

It is pushed an error:

[Symfony\Component\Console\Exception\RuntimeException]
The “–2” option does not exist.

I’m guessing your composer is so old I doesn’t know about version 2 yet.

Try running composer self-update first so you’ll get a newer version that does know about composer 2 and then run composer self-update --2

You are right. It is working now.
1.1. composer self-update <!-- a newer version that does know about composer -->
1.2. composer self-update --2

Thank you for a message. It is a basics.