npm i -g yarn -- install globally first yarn policies set-version berry -- set the version to v2 ( berry ) yarn set version from sources -- install the latest build from version
reference: https://yarnpkg.com/getting-started/install