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

后端 未结 14 2125
孤街浪徒
孤街浪徒 2020-12-03 05:09

I moved my project from desk to another.
When I run php artisan it does not work.

I tried to run composer update, but it returns the

14条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 05:51

    I was upgrading my Laravel from 5.8 to 8.0 and I got this error.

    So my fixes were

    1. As @nobuhiroharada mentioned that I had missed .env file in my project

    2. Second is that Laravel removed Exception and replaced it with Throwable. So we need to fix that in our app\Exceptions\Handler.php. One can refer Medium.com for the error fix.

    3. In the upgrade guide of Laravel 8.x you need to update the dependencies like this

    4. Next, in your composer.json file, remove classmap block from the autoload section and add the new namespaced class directory mappings:

    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },

    1. Finally from bootstrap\cache delete the cache files and run composer update.

    These 5 steps might help you remove the error you are facing in your Laravel Project.

提交回复
热议问题