I am working on a laravel based project.
Like everyday, I am trying to hit this command to run my project on server: php artisan serve
But I am getting this error:
Class 'Composer\InstalledVersions' not found
I have tried below commands, but they don't seem to work:
composer update
composer update --no-scripts
php artisan optimize
composer dump-autoload
php composer.phar install --prefer-dist
php artisan package:discover --ansi
I also faced same issue when i'm trying to update my composer dependencies. use below commands to overcome this issue.
first you need to update composer version 2.0+
it works fine after upgrading to Composer 2.0+. Maybe you are using an old version of 1.0+. 'Composer\InstalledVersions' is onl for the Composer 2.0+.
You can use sudo composer self-update --2 to update composer version make sure your composer changes not reflect to your other projects
now you should able to update composer using composer update.
hope this will helps you!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With