0

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

2 Answers 2

0

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.

2
  • 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 Commented Apr 26, 2022 at 5:33
  • Thanks for your help. I ran again the command "composer config -g repo.packages composer packages.drupal.org/8" now it's working fine. Commented Apr 26, 2022 at 6:29
-1

I ran this composer config command, then it works.

"composer config -g repo.packages composer https://packages.drupal.org/8" 
3
  • 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? Commented Apr 26, 2022 at 9:43
  • 1
    Your answer will work only on the computer you executed that command.
    – mona lisa
    Commented Apr 26, 2022 at 14:07
  • Yes, you are correct. I am not sure. Commented Apr 27, 2022 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.