Unable to add patches via composer when we run "composer install" or "composer update" I am facing an issue wherein I have added a single patch in my composer.json under &quot;extras&quot;
   &quot;patches&quot;: {
            &quot;drupal/field_validation&quot;: {
                &quot;Declaration of (...)FieldValidationRuleAddForm::buildForm&quot;: &quot;https://www.drupal.org/files/issues/2941006-php-incompatible-buildform-signature.patch&quot;
            },
            &quot;drupal/ubercart&quot;: {
                &quot;Not_yet_ported (missing)&quot;: &quot;https://www.drupal.org/files/issues/2020-05-28/ubercart_remove_not_yet_ported.patch&quot;
            }
        },
        &quot;enable-patching&quot;: true

After adding the patch under composer.json
I ran
composer install

but still it does not apply the patches listed.
The solution was
composer require cweagans/composer-patches

we need to be sure that above package is included
After adding the above I was able to add patches via composer.json