1

I'm installing a new Laravel 5.6 ambient with composer, but every time i do a "Laravel new projectName", when i run composer install or composer update, it returns this error:

Could not scan for classes inside "path/to/vendor/hamcrest/hamcrest-php/hamcrest" which does not appear to be a file nor a folder

After hours of trying to fix it, I made a test, manually creating the hamcrest folder. When i ran composer install again, it pointed that composer couldn't read a file in the "psysh" library, when i went to check it, the folder was completely empty. I downloaded the files again and put them in the folder, just to test if it was going to run. After doing that and running composer install, this error popped out

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover

In ProviderRepository.php line 208: Class 'Laravel\Tinker\TinkerServiceProvider' not found

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

I don't know where i messed up, since this is a fresh install of composer + laravel. I ran composer diagnose, but everything is ok. Does anyone where is my error?

1 Answers1

0

Laravel Tinker

composer require laravel/tinker

Once the package has been installed, you should add Laravel\Tinker\TinkerServiceProvider::class to the providers array in your config/app.php configuration file.

then in console, make a

composer dump-autoload
  • I tried that solution, composer require laravel/tinker returns same error: > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover In ProviderRepository.php line 208: Class 'Laravel\Tinker\TinkerServiceProvider' not found – Fernando Almeida Jul 18 '18 at 20:16
  • did you include this `Laravel\Tinker\TinkerServiceProvider::class` to the providers array in your config/app.php ? and try `composer dump-autoload --no-scripts` – Marcus Stratu Jul 18 '18 at 20:24
  • I've tried to include the class in the array, but it didn't work. composer dump-autoload --no-scripts ran without problems – Fernando Almeida Jul 18 '18 at 20:39