1. cd to yarn install directory

     $cd D:\programs\yarn
    
  2. Start by enabling Corepack, if it isn't already

     $corepack enable
    
  3. Then initialize

     $yarn init -2
    
  4. Finally update

     $yarn set version stable
     $yarn install
    
TIP
Yarn also frequently ships Release Candidate builds. Use $yarn set version canary should you need a feature not released on the stable channel yet. Those builds are very stable, the only difference with the regular channel being a more staggered migration between major as we implement new breaking changes.
ย