'Please provide a valid cache path error in Laravel 9
I'm working with Jetstream library with Laravel 9, And I've deleted the storage folder by the wrong, and then it shows the following error.
Please provide a valid cache path.
What should I do? I tried the command composer install, and I faced the same error! So how can I return back to the storage folder?
Solution 1:[1]
create the following
storage/app
storage/app/public
storage/framework
storage/framework/cache
storage/framework/cache/data
storage/framework/views
storage/framework/session
storage/logs
And use git to manage your code so that accidents like this are easily recovered
Solution 2:[2]
- Open your terminal.
- Run
cd YOUR_LARAVEL_PATHto navigate to the Laravel directory. - Run
mkdir storage/framework/{cache,sessions,views}to create missing directories. - Run
php artisan cache:clear - Run
php artisan config:clear - Run
php artisan view:clear - Run
chmod -R 777 storageto set write permissions (depends on your system).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Snapey |
| Solution 2 | NickSdot |
