1

i have a laravel project on my github. and i recently cloned to my pc but for some reason i got this error:

Generating optimized autoload files

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

In Compiler.php line 36:

Please provide a valid cache path.


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

I created cache, sessions and framework folder inside storage folder but it does not work.

I also tried many things I read on forums and here on stack but nothing works with me.

i really don't know what's happening.

4
  • Do you have the "vendor" folder? Usually when you get a laravel project from online repositories the "vendor" folder is in .gitignore. You have to install it when you get it locally by "composer update" or "composer install" Commented Feb 2, 2019 at 13:48
  • can you run "composer global update" ? Commented Feb 2, 2019 at 13:56
  • i tried run this command but the system cant find composer.json. in laravel project folder there is a composer.json. but in composer folder there's not. should i create one? Commented Feb 2, 2019 at 14:48
  • 1
    The exception was thrown in Compiler.php line 36 because $cachePath is false. You can try trace back the error with debug_backtrace(), see what you can find. Commented Feb 2, 2019 at 15:32

1 Answer 1

2

At first run: composer update

Create these folders under storage/framework:

  • sessions
  • views
  • cache

and run this below commands:

  • php artisan cache:clear
  • php artisan config:clear
  • php artisan view:clear
Sign up to request clarification or add additional context in comments.

1 Comment

for some reason, .gitinore was set to ignore a lot of important files to project. but your answer helps me a lot. ty.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.