Error:
Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover --ansi
Solution:
Such issues may be caused by outdated (cached) local dependencies or the composer.lock file. After removing all dependencies and locking the file, you can attempt to reinstall them all.
Do this inside the app base directory to delete the downloaded dependencies;
sudo rm -rf vendor/
After that deleteĀ composer.lockĀ file by executing;
sudo rm composer.lock
And finally, execute;
composer install








