Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Amidamaru's avatar

Laracasts/Flash and Script php artisan clear-compiled handling the post-install-cmd event returned with an error

I tried to clone my simple laravel web application from bitbucket to my vagrant homestead box. I am using Windows 8.1 as the host OS.

The vendor folder is not included after cloning so i executed composer install. After executing the composer install command, the git bash command line prompted me with the error below:

Generating autoload files
> php artisan clear-compiled

Script php artisan clear-compiled handling the post-install-cmd event returned with an error

  [RuntimeException]
  Error Output:
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

**Problems **

  1. Script php artisan clear-compiled handling the post-install-cmd event returned with an error
  2. laracasts/flash is having an error with bindShared()

Any help is appreciated. Thank you

0 likes
1 reply
Amidamaru's avatar
Amidamaru
OP
Best Answer
Level 3

I was able to solve this issue by following the steps below:

  • clone laravel project from repo. to homestead box
  • temporarily remove Laracasts\Flash\FlashServiceProvider::class and 'Flash' => Laracasts\Flash\Flash::class from app.php
  • execute composer install and composer update
  • add FlashServiceProvider and alias back to app.php

Please or to participate in this conversation.