October 22, 2024
Chicago 12, Melborne City, USA
PHP

Why I get fatal error when trying to run composer update in empty laravel project?


I am created new laravel project, ran composer update and get this error:

> @php artisan package:discover

Fatal error: Uncaught Error: Call to undefined method Composer\Repository\PlatformRepository::isPlatformPackage() in /var/www/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php:139
Stack trace:
#0 /var/www/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php(163): Composer\Json\JsonManipulator->Composer\Json\{closure}('php')
#1 [internal function]: Composer\Json\JsonManipulator->Composer\Json\{closure}('php', 'matviib/telegra...')
#2 /var/www/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php(164): uksort(Array, Object(Closure))
#3 /var/www/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php(119): Composer\Json\JsonManipulator->sortPackages(Array)
#4 /var/www/app/vendor/php-http/discovery/src/Composer/Plugin.php(445): Composer\Json\JsonManipulator->addLink('require', 'php-http/messag...', '*', true)
#5 /var/www/app/vendor/php-http/discovery/src/Composer/Plugin.php(176): Http\Discovery\Composer\Plugin->updateComposerJson(Array, true)
#6 [internal function]: Http\ in /var/www/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php on line 139

What is the reason of this error? Looks like some problem inside Composer code so I don’t even know what to do with this.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video