laravel项目执行composr install
或者composer update
时,出现如下错误
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
InvalidArgumentException
Please provide a valid cache path.
at vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36
32▕ */
33▕ public function __construct(Filesystem $files, $cachePath)
34▕ {
35▕ if (! $cachePath) {
➜ 36▕ throw new InvalidArgumentException('Please provide a valid cache path.');
37▕ }
38▕
39▕ $this->files = $files;
40▕ $this->cachePath = $cachePath;
+20 vendor frames
21 [internal]:0
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
+5 vendor frames
27 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
解决方法很简单,创建几个文件夹即可
在 storage/framework
下面创建 sessions
、 views
、 cache
三个文件夹即可
cd storage
mkdir framework
cd framework
mkdir sessions
mkdir views
mkdir cache
别忘记给storage文件夹权限,回到laravel项目根目录
chmod -R 777 storage
viencoding.com版权所有,允许转载,但转载请注明出处和原文链接: https://viencoding.com/article/289