"Please provide a valid cache path" error in laravel

I duplicated a working laravel app and renamed it to use for another app. I deleted the vendor folder and run the following commands again:

composer self-update

composer-update

npm install

bower install

I configured my routes and everything properly however now when I try to run my app in my browser I get the following errors:

InvalidArgumentException in Compiler.php line 36: Please provide a valid cache path.

ErrorException in Filesystem.php line 111: file_put_contents(F:\www\example\app\storage\framework/sessions/edf262ee7a2084a923bb967b938f54cb19f6b37d): failed to open stream: No such file or directory

I have never had this issue before, I do not know what is causing it neither do I know how to fix it, I have googled online for a solution but have found none so far.


Solution 1:

Try the following:

create these folders under storage/framework:

  • sessions
  • views
  • cache

Now it should work

Solution 2:

Try this:

  1. php artisan cache:clear
  2. php artisan config:clear
  3. php artisan view:clear

Solution 3:

So apparently what happened was when I was duplicating my project the framework folder inside my storage folder was not copied to the new directory, this cause my error.