I would definitely persevere via removing vendor folder, but also remove composer.lock and then run composer install.
Composer - "Could not scan for classes inside..."
So I've been having a nightmare of a time with Composer and can't find a solution anywhere. I'm not at all an experienced developer so any help would be sincerely appreciate!
I have an app on Laravel 5.8 I needed to update and when I went to add a new package, I ran into the "composer memory limit" issue. Updating to version 2 seemed to fix it, but now when I try to update my dependencies, I keep running into:
[RuntimeException]
Could not scan for classes inside "C:\laragon\www\test\vendor/phpunit/php-code-coverage/src/" which does not appear to be a file nor a folder
Exception trace:
() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:71
Composer\Autoload\ClassMapGenerator::createMap() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Autoload/AutoloadGenerator.php:395
Composer\Autoload\AutoloadGenerator->generateClassMap() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Autoload/AutoloadGenerator.php:381
Composer\Autoload\AutoloadGenerator->addClassMapCode() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Autoload/AutoloadGenerator.php:277
Composer\Autoload\AutoloadGenerator->dump() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Installer.php:314
Composer\Installer->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Command/InstallCommand.php:131
Composer\Command\InstallCommand->execute() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:310
Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:122
Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/composer:63
require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24
I've tried deleting my vendor folder followed by "composer clearcache" and running update, but no luck.
If this additional info helps, I also tried moving to wamp and laragon from xampp while trying to fix the memory limit issue, which means I'm also trying to work with setting up the app locally again from my repo. As a result I can't run "composer dump-autoload":
PS C:\laragon\www\test> composer dump-autoload
Generating optimized autoload files
Class Illuminate\Foundation\ComposerScripts is not autoloadable, can not call post-autoload-dump script
> @php artisan package:discover
Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\laragon\www\test\bootstrap\app.php:14
Stack trace:
#0 C:\laragon\www\test\artisan(20): require_once()
#1 {main}
thrown in C:\laragon\www\test\bootstrap\app.php on line 14
PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\laragon\www\test\bootstrap\app.php:14
Stack trace:
#0 C:\laragon\www\test\artisan(20): require_once()
#1 {main}
thrown in C:\laragon\www\test\bootstrap\app.php on line 14
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255
So I don't know if one issue is causing the other or vice-versa. Any help would be sincerely appreciated since I'm completely at a loss and need to be able to update this site soon.. Thank you!
So I updated to composer 2.0.5 -> 2.0.6, did dump-autoload then update, and it worked fine? I'm glad it's working, but now I'm just terrified that this will happen again down the road..
Please or to participate in this conversation.