Best Practice for Ninja build Visual Studio?

The Ninja (really, all non-IDE generators) expect the environment to have the compilers set up already. You’ll need to load the compiler environment before you can use such generators. Granted, this is “easy” on Unix-like platforms since the compiler is usually set up system-wide, but this is not the case for the Visual Studio toolchains (among other compilers in various places and systems which use module load to make toolchains available).