Composer error: Command "require" failed. You must be using the interactive console to authenticate

Composer error: Command "require" failed. You must be using the interactive console to authenticate




This error appears when Composer is unable to locate the PHP version with which it can work. The located version can be either not supported or not found at all. To help composer find the PHP version that is being used by Magento, it is required to set an absolute path to the PHP executable file like this:

/usr/bin/local/php74 composer require amasty/module-name

The location of the executable file may differ from server to server. For example,

/opt/plesk/php/7.0/bin/php 
/opt/php/php-7.0/bin/php
/usr/local/php70/bin/php-cli