Vlael
Vlael

Reputation: 32

Installing laravel suddenly some json file cannot be downloaded

I typed create-project laravel/laravel "foldername" and got this message:

[Composer\Downloader\TransportException] The "http://packagist.org/p/illuminate/console%241d2f57f687204b9a57e5848fe9f49e79bc2fb7ed0cafc6d1387ad4760a1b155c.json" file could not be downloaded (HTTP/1.1 404 Not Found)

What's this for? I already got the laravel structure files but i don't want to continue without knowing whats with this error.

Update: composer.json content under my laravel folder structure

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.4.*",
    "laravel/tinker": "~1.0"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~5.7"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
"scripts": {
    "post-root-package-install": [
        "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ],
    "post-install-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postInstall",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postUpdate",
        "php artisan optimize"
    ]
},
"config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
}

}

Upvotes: 0

Views: 4111

Answers (3)

João Ceni
João Ceni

Reputation: 11

You need php curl module for this to work properly.

Check if you have php-curl with php -m

if Curl is not present on the list, install it with (debian) apt install php***-curl replacing *** with your php version

apt install php7.4-curl works for debian with php 7.4 installed.

Try again after installing the curl php module and voilá

Upvotes: 1

Thomas Pane
Thomas Pane

Reputation: 31

This worked for me on Linux. It prioritized ipv4 over ipv6.

sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

Upvotes: 2

Leo
Leo

Reputation: 7420

add this on your composer:

"repositories": [
    {
         "type": "composer", 
         "url": "https://packagist.org"
    },
    { "packagist": false }
]

and run composer update once again. If not then run composer self-update

Upvotes: 4

Related Questions