How to update to composer 2.0

on fresh OS and fresh DA it's 2.0 by default. Maybe you have outdated OS or DA?
 
Very strange. I build again and I see:

[root@vmi916035 custombuild]# ./build composer
Downloading composer.phar.2.3.7...
######################################################################### 100.0%
Composer 2.3.7 Installed.

But everytime when I try install via composer then I get:
Validating
Command "show" failed:
In BaseIO.php line 129:

Your github oauth token for github.com contains invalid characters: "ghp_Am
tx59efU9ODAxxxxxxxxxx"




I research this issue on Google, and they said require latest version composer. So I think now I have latest version and still the same issue. Can anyone know this issue?

@update
i;m using Magento, and read documentation:

and I try run from magento root:
composer require composer/composer:1.10.21

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires composer/composer 1.10.21, found composer/comp oser[1.10.21] but these were not loaded, likely because it conflicts with anothe r require.
 
Last edited:
@Erulezz
Composer version 2.3.7 2022-06-06 16:43:28

Can you please check my update last post?


@update
I found one solution but im not sure, where I should change this or how to find?

73
You can try Basic Auth instead:
Change this (oauth):
"github-oauth": {
"github.com": "ghp_[YOUR-PERSONAL-TOKEN]"
}

To this (basic auth):
"http-basic": {
"github.com": {
"username": "[YOUR-GITHUB-USERNAME]",
"password": "ghp_[YOUR-PERSONAL-TOKEN]"
}
}
 
That needs to be changed in the auth.json file, i’m on mobile right now so can’t check exact location but it’s somewhere under ~/.composer or ~/.config/composer
 
Back
Top