Error : Unsupported declare strict_types
in
../vendor/magento/inventory-composer-installer
while install the extension using composer in Magento 2.3.0.
Magento – Unsupported declare ‘strict_types’ in Magento 2.3.0
composermagento2magento2.3.0
Related Topic
- Magento – Update Magento 2.2.7 -> 2.3.0 trows error
- Magento – Magento 2 : Error While upgrade 2.3.0 to 2.3.1
- Magento – Magento 2.3.1 Composer Fatal error when installing Ext
- Magento – strict_types declaration must be the very first statement in magento 2.3.1
- Magento – Composer error when try install extension
Best Answer
I had the same issue, it is due to the version of PHP you are using, and the version of PHP required for Composer.
My CLI was using PHP 5.4, but I had to run it on 7.2.
So instead of running something like:
I ran:
Hope this helps. I was confused on this for a little while, as the error doesn't seem related to the PHP version, but seems like more of a bug with the installation.