1. First use the command
npm install -g yarn
2. Add the yarn path to path in the environment variable
In the above two steps last night, enter yarn -version on the command line and you can see that the yarn version has been configured successfully.