Hi,
Maybe you don’t have visual studio installed or not all the required C++ packages to build.
There are explanation on how install visual studio properly for building UE5 project here or google it.
Don’t forget to apply solved if this is the solution
Thanks