执行 php artisan config:clear 时,报错:ErrorException : include(E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php): failed to open stream: No such file or directory
1、执行 php artisan config:clear 时,报错:ErrorException : include(E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php): failed to open stream: No such file or directory。如图1
PS E:\wwwroot\object> php artisan config:clear ErrorException : include(E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php): failed to open stream: No such file or directory at E:\wwwroot\object\vendor\composer\ClassLoader.php:571 567| * @private 568| */ 569| function includeFile($file) 570| { > 571| include $file; 572| } 573| Exception trace: 1 include() E:\wwwroot\object\vendor\composer\ClassLoader.php:571 2 Composer\Autoload\includeFile("E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php") E:\wwwroot\object\vendor\composer\ClassLoader.php:428 Please use the argument -v to see more details.
2、确认文件 Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php 已经不存在,被重命名为:Modules/OnlineStoreThemeGraphQL/Providers/GraphQlResolverServiceProvider.php
3、执行:composer install 命令,以重新生成 vendor\composer\ClassLoader.php。报错:In ProviderRepository.php line 208: Class ‘Modules\ThemeStoreGraphQL\Providers\GraphQlResolverServiceProvider’ not found Script @php artisan package:discover –ansi handling the post-autoload-dump event returned with error code 1。如图2
PS E:\wwwroot\object> composer install Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Package operations: 0 installs, 29 updates, 0 removals ... > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover --ansi In ProviderRepository.php line 208: Class 'Modules\ThemeStoreGraphQL\Providers\GraphQlResolverServiceProvider' not found Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
4、原因在于 /config/app.php 的 providers 中包含:\Modules\ThemeStoreGraphQL\Providers\GraphQlResolverServiceProvider::class,
5、再次执行:composer install、php artisan config:clear,皆运行成功。
PS E:\wwwroot\object> composer install Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Nothing to install, update or remove ... Package manifest generated successfully. 111 packages you are using are looking for funding. Use the `composer fund` command to find out more! PS E:\wwwroot\object> php artisan config:clear Configuration cache cleared!
近期评论