0

I'm a bit of a newbie to PHP in general and the common solutions such as running composer update and other similar suggestions such as the ones featured in this post didn't work. Here is the complete error message when I try to run '''composer update'''

'''> Illuminate\Foundation\ComposerScripts::postAutoloadDump

@php artisan package:discover --ansi

In Finder.php line 640:

The "" directory does not exist.

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1'''

I suppose my not really knowing composer well does not help. I believe a path is missing to some folder or file in a config or .env file somewhere.

Here is the boilerplate's composer.json file I am starting with:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^8.1",
        "guzzlehttp/guzzle": "^7.5",
        "laravel/framework": "^10.3.2",
        "laravel/sanctum": "^3.2.1",
        "laravel/tinker": "*",
        "phpoffice/phpspreadsheet": "^1.29"
    },
    "require-dev": {
        "fakerphp/faker": "^1.21.0",
        "laravel/pint": "^1.6",
        "laravel/sail": "^1.21.2",
        "mockery/mockery": "^1.5.1",
        "nunomaduro/collision": "^7.1",
        "phpunit/phpunit": "^10.0.15",
        "spatie/laravel-ignition": "^2.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": [ "laravel/dusk"]
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}

DarHa
  • 1
  • 1
    That sounds like a flaw in Illuminate\Foundation\ComposerScripts::postAutoloadDump , have you reported the issue to the project itself? What did you do and in which directory beforehand? Also when asking about an issue with composer-php on SO , please see https://getcomposer.org/doc/articles/troubleshooting.md beforehand, there are some general steps you should follow. And for Q&A, with only the error message I'd suggest you continue to search for known cases, e.g. https://stackoverflow.com/q/44004461 , https://stackoverflow.com/q/68662570 , https://stackoverflow.com/q/75273099 and so on ... . – hakre Jul 13 '23 at 23:46

0 Answers0