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

后端 未结 14 2120
孤街浪徒
孤街浪徒 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:54

    I had this same problem when running composer update in a Laravel project. In the package.json it's configured to run artisan package:discover, which failed with:

    Class 'Symfony\Component\Translation\Translator' not found in vendor/nesbot/carbon/src/Carbon/Translator.php on line 18

    When I looked in the vendor/symfony/translation directory I found that it was completely empty, which explained the error.

    The solution was to completely delete the vendor directory and then re-run composer update. This was the only way that I was able to make composer install the missing files.

    0 讨论(0)
  • 2020-12-03 05:55

    If this happened after Laravel update from 6.x to 7.x, then this could be due to the update of Symfony. See the upgrade guide of this part: https://laravel.com/docs/7.x/upgrade#symfony-5-related-upgrades

    0 讨论(0)
提交回复
热议问题