Score:0

Composer\Downloader\TransportException: The "drupal.org/packages.json" file could not be downloaded (HTTP/1.1 404 Not Found)

gs flag

In Drupal 8.9.x, After composer cache-clear. I am getting this error [Composer\Downloader\TransportException] The "drupal.org/packages.json" file could not be downloaded (HTTP/1.1 404 Not Found) .

I can't run the composer install or composer update.

I tried to remove the vendor folder & composer.lock files too.

Even i tried,

But no luck.

is something wrong? before the composer cache clear it was working fine. it happens only on after composer cache clear. Any help appreciated.

    "repositories": [
            {
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            },
            .....

enter image description here

Score:0
id flag

The drupal package repository is https://packages.drupal.org/8, none other. it should appear, in most cases, alone as the only added repo in composer.json:

    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }

But as you have done it, with a named key, it will be as follows, which should be fine:

    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },

I think the problem you are experiencing is that by passing the -g flag to composer, you are setting the value globally (for all projects) but the project's own composer.json may have a differing, or a wrong, configuration.

Thirsty Six avatar
gs flag
Yes, i tried with named key. but, its shows [Seld\JsonLint\ParsingException] "./composer.json" does not contain valid JSON Parse error on line 17: ... }, }, { ---------------------^ Expected: 'STRING' - It appears you have an extra trailing comma
Thirsty Six avatar
gs flag
Thanks for your help. I ran again the command "composer config -g repo.packages composer https://packages.drupal.org/8" now it's working fine.
Score:-1
gs flag

I ran this composer config command, then it works.

"composer config -g repo.packages composer https://packages.drupal.org/8" 
Thirsty Six avatar
gs flag
Actually, I am not sure about composer cache-clear. it's started working on after 20-24 hrs. don't know why. is something bitbucket related config?
id flag
Your answer will work only on the computer you executed that command.
Thirsty Six avatar
gs flag
Yes, you are correct. I am not sure.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.