When you install some new extension package in Magento 2 via the composer you can get an error:
[InvalidArgumentException]
Package vendor/module-name exists in composer repo (https://repo.packagist.org) and composer repo (https://repo.magento.com) which has a higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.
1. Open composer.json file in your Magento 2 root directory.
2. Find the "repositories" section.
3. Replace the following code:
"type": "composer",
"url": "https://repo.magento.com/"
with this one
"type": "composer",
"url": "https://repo.magento.com/",
"canonical": false
4. Save the changes and try to install Magento 2 extension again.