'How to upgrade Yarn to latest version globally

Is there any way to upgrade Yarn to latest version i.e 3.x globally cause I only know how to upgrade Yarn to latest version in a repo only.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source