2

I'm trying to install a custom Magento2 module using composer.

The module version is 2.4.0, here below my composer.json file:

{
  "name": "fattura24/app-fatturazione",
  "description": "Module to add Fattura24 to Magento2",
  "require": {
    "php": "~5.5.22|~5.6.0|7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0|~7.2.10"
  },
  "type": "magento2-module",
  "version": "2.4.0",
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Fattura24\\AppFatturazione\\": ""
    }
  }
}

I open the terminal and I type:

composer require Fattura24/app-fatturazione

as a result I get this error message:

[InvalidArgumentException]                                   
  Package Fattura24/app-fatturazione at version  has a PHP re  
  quirement incompatible with your PHP version (7.2.10)  

then I checked my php version by php -v command, and I got this result:

PHP 7.2.10 (cli) (built: Oct  9 2018 14:56:43) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Any suggestions? thanks to all

P.S.: by using the command composer require Fattura24/app-fatturazione --ignore-platform-reqs I succeeded in installing a previous version of the plugin, but I want to get the latest.

1
  • which Magento version you're using?
    – Mohit Rane
    Commented Jul 8, 2019 at 11:11

1 Answer 1

1

You should remove ~7.2.0|~7.2.10 from composer.json

Change PHP version according to your Magento version, refer below link if you're using Magento 2.2.x

https://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html

For Magento 2.3.x

https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

You should only use PHP version 7.2 when you're working on Magento 2.3.x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.