Cannot compile standard UE4 Engine from Epic Github - What am I doing wrong?

Background: My game (First Person) needs to run as a dedicated server, so I cannot use the packaged Unreal Editor that one gets through the launcher. I am using VS2019 Community Edition on Windows 10.

Steps followed: Downloaded Git repository for 4.27.2 via the .zip and the Github Desktop (tried both). Ran Setup.bat, then GenerateProjectFiles, and then compile the engine. This succeeds - so what’s the problem, you ask?

Problem: I run the editor, create a game (First Person, c++, starter content). I follow the sample blank project given here: Setting Up Dedicated Servers | Unreal Engine 4.27 Documentation creating a new [Project]Server.Target.cs. Regenerate project files, reload in VS. While the game target builds, when I try to build the server target it fails with 45 errors, many of them apparently linked to ‘chaos’, with missing headers and a number of other issues. I tried this several times, redownloading the repository each time, all to no avail. On various forums I have found that issues with compiling this version of the engine go back 6 months and do not appear to have been addressed.

Solution: I deleted everything and tried to get 4.26 (pre-chaos). Follow the same procedure, but now UE4 itself doesn’t build: “the referenced component ‘MobileDeviceInterface’ could not be found”. I can find nothing indicating how to fix this error.

Question: What am I doing wrong? If ‘nothing’, then what do I need to do to build a version of the UE4 engine - any version! (my initial project for the meshes I wish to use is 4.25) - and then get a c++ project that completely compiles before I add any actual code?

EDIT: Forgot to mention that no version of Unreal Engine is installed on this particular machine (just the launcher app), though it’s hard to understand why that would be necessary. The original machine I build the test project on does not have the 100+GB space required by the repository and the build.

I have solved this issue, though in truth there were 2 problems that I had thought were linked but were not.

The missing MobileDeviceInterface component was not correctly loaded into the project with the Git repository Setup or GenerateProjectFiles executables. However, the .dll is part of the package. Removing the failing component from the project and then adding the .dll in its place corrected this error.

I had assumed this fault with the component (which was only a warning iirc) had caused the error which was error MSB3037 “Waitmutex exited with code 6”, but this was not the case as it persisted. I discovered the error here was my own.

When cloning the Github repository, the files were stored as part of the MyDocuments tree on my machine (a length path indeed), which caused one of the files to fail to clone due to a file name length error (since the filename used as part of the process included the folder name). Therefore, I created my own folder off the root folder and cloned the repository there.

Unfortunately, I unwittingly included a space in the folder name, which in turn caused an extra command line parameter to be passed to the makefile script since the path is not included within quotes in the script itself. Removing the space from the folder name and rebuilding the UE4 solution successfully compiled and thereafter no further errors occurred.