Script @php artisan package:discover handling the

2019-02-18 05:28发布

问题:

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 error

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

回答1:

I solved the problem this way:

cd bootstrap/cache/
rm -rf *.php


回答2:

Do you have .env file in your new project?

I had same error message. When I add .env file, error is gone.

success message like this.

Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: ixudra/curl
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: socialiteproviders/manager
Package manifest generated successfully.

I hope this will help you.



回答3:

maybe you have an error in the project code (for example, in routes or controller). This may be one of the reasons for this error.

In my project, the web.php file has a syntax error. I defined this when I started the php artisan command

C:\OSPanel\domains\lara.shop.loc>php artisan
In web.php line 
  syntax error, unexpected end of file