手动清除编译的类 - Laravel

9 浏览
0 Comments

手动清除编译的类 - Laravel

我更新了我的代码库后收到了一个错误,但我似乎无法解决它。我曾经使用了一个包,但现在不再使用了,我按照正确的步骤去像这篇答案那样删除这个包,但我进行的所有控制台操作都失败了。

我尝试运行了:

composer update

但我得到了这个错误:

user@my-app:~/example.com$ php artisan clear-compiled
PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Travoltron\Plaid\PlaidServiceProvider' not found in /home/user/example.com/bootstrap/cache/compiled.php:7825
Stack trace:
#0 /home/user/example.com/bootstrap/cache/compiled.php(7811): Illuminate\Foundation\ProviderRepository->createProvider('Travoltron\\Plai...')
#1 /home/user/example.com/bootstrap/cache/compiled.php(7787): Illuminate\Foundation\ProviderRepository->compileManifest(Array)
#2 /home/user/example.com/bootstrap/cache/compiled.php(1937): Illuminate\Foundation\ProviderRepository->load(Array)
#3 /home/user/example.com/bootstrap/cache/compiled.php(2357): Illuminate\Foundation\Application->registerConfiguredProviders()
#4 /home/user/example.com/bootstrap/cache/compiled.php(1796): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#5 /home/user/example.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kerne in /home/user/example.com/bootstrap/cache/compiled.php on line 7825
PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Travoltron\Plaid\PlaidServiceProvider' not found in /home/user/example.com/bootstrap/cache/compiled.php:7825
Stack trace:
#0 /home/user/example.com/bootstrap/cache/compiled.php(7811): Illuminate\Foundation\ProviderRepository->createProvider('Travoltron\\Plai...')
#1 /home/user/example.com/bootstrap/cache/compiled.php(7787): Illuminate\Foundation\ProviderRepository->compileManifest(Array)
#2 /home/user/example.com/bootstrap/cache/compiled.php(1937): Illuminate\Foundation\ProviderRepository->load(Array)
#3 /home/user/example.com/bootstrap/cache/compiled.php(2357): Illuminate\Foundation\Application->registerConfiguredProviders()
#4 /home/user/example.com/bootstrap/cache/compiled.php(1796): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#5 /home/user/example.com/ in /home/user/example.com/bootstrap/cache/compiled.php on line 7825

我已经尝试运行了这些命令,但仍然收到相同的错误:

composer install
composer dump-autoload
php artisan config:cache
php artisan config:clear
php artisan clear-compiled

我的问题是,既然看起来它只是捕捉到已编译类的缓存版本,是否有任何办法通过手动删除编译缓存来解决,因为我无法通过命令来解决?

admin 更改状态以发布 2023年5月21日
0
0 Comments

你可以删除 /bootstrap/cache 中的所有缓存文件,然后再次自动加载Composer。

在应用程序目录中运行以下命令。

rm -r bootstrap/cache/*
composer dump-autoload

0