Issue description
You must address dependency resolution errors while you use packagist as a repository name in a composer.json file. These errors occur even if composer diagnose indicates that all connections work correctly.
Symptoms
Accessibility of all repositories is reported by the composer diagnose command.
Dependency resolution errors can cause composer update or composer install to fail.
found [package] in the lock file but not in remote repositoriesRoot cause
Composer reserves the repository name packagist because it refers to the default package repository at https://packagist.org. When packagist is used as a custom repository name, it creates a naming conflict that prevents Composer from resolving dependencies.
Solution
Rename the custom repository from packagist to a different descriptive name in the composer.json file.
Before (configuration that causes errors):
{
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"packagist": {
"type": "composer",
"url": "https://asset-packagist.org"
}
}
}After (fixed configuration):
{
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"asset-packagist": {
"type": "composer",
"url": "https://asset-packagist.org"
}
}
}Use descriptive alternatives such as:
asset-packagist
bower-packagist
npm-packagist
custom-assets
company-packages
Steps to fix
To resolve the naming conflict:
Open the composer.json file.
Locate the repositories section.
Find any repository named packagist.
Rename the repository to a descriptive alternative such as asset-packagist.
Save the file.
Run composer update to verify the fix.
Why this happens
Composer reserves packagist as a special repository name.
The naming conflict prevents proper dependency resolution.
Verifies that connectivity is handled by composer diagnose, though it does not check for naming conflicts.
The issue appears only during package installation or updates.
Important notes
This issue is a configuration error rather than a problem with the repository service.
The repository URL remains unchanged.
This fix does not affect project features.
The issue affects all Composer 2.x versions.