endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.46k stars 728 forks source link

Uncaught TypeError: Return value of Endroid\Installer\Installer::activate() #209

Closed rizwansaleem70 closed 5 years ago

rizwansaleem70 commented 5 years ago

After deploying project on linux hosting. I was adding a new package using SSH access.

I run command composer require PACKAGE_NAME

I got this error:

Fatal error: Uncaught TypeError: Return value of Endroid\Installer\Installer::activate() must be an instance of /vendor/endroid/installer/src/Installer.php:37

Even simple composer command isn't working. I'm getting the same error again and again. I can't add more packages.

PHP version: 7.1.3 Composer version: 1.7.2 Screenshot_5

endroid commented 5 years ago

Hi @webribs looks like something is wrong with your PHP installation. PHP 7.1 should support void return types and only versions before 7.1 (or a corrupted version) should give this message. Make sure you execute the composer install command in PHP 7.1. I.e. sometimes people using Docker accidentally execute commands from outside the container in a different / incompatible PHP version.

Good luck!