Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: You made a reference to a non-existent script @php artisan package:discover

I am getting error at running composer dump-autoload at laravel project

composer dump-autoload
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
You made a reference to a non-existent script @php artisan package:discover

Then executing php artisan package:discover returns

Discovered Package: barryvdh/laravel-ide-helper
Discovered Package: cartalyst/sentinel
Discovered Package: laravelcollective/html
Discovered Package: laracasts/generators
Package manifest generated successfully.

Then again getting the same error

composer dump-autoload
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
You made a reference to a non-existent script @php artisan package:discover

What may be wrong? composer self-update or composer global update not helping.

like image 956
Syed Waqas Bukhary Avatar asked Dec 11 '22 08:12

Syed Waqas Bukhary


1 Answers

Okay, I think that composer dump-autoload is working even with that warning. (thanks to the user:Sohel0415 comments) composer was not able to run script with @ symbol in composer.json file.

If you want to get rid of this warning simply do

composer dump-autoload --no-scripts

or

you may delete the script with @ "post-autoload-dump": [] from you "scripts": {} in the composer.json file temporarily, and it should be all good.

like image 167
Syed Waqas Bukhary Avatar answered May 02 '23 23:05

Syed Waqas Bukhary