Yes, running yarn build
inside WSL is a requirement if you’re using Windows. WSL is the Windows Subsystem for Linux.
You must install WSL, and run all your build commands inside of it.
The installation guide links you to the Microsoft site, and takes you through installing and setting it up.
You might also find the solution to this thread useful.