Platform Mac is not a valid platform to build. Check that the SDK is installed properly and that you have the necessary platorm support files (DataDrivenPlatformInfo.ini, SDK.json, etc).

when creating a new unreal engine project using C++
I encounter this

Setting up bundled DotNet SDK
/Users/Shared/Epic Games/UE_5.4/Engine/Build/BatchFiles/Mac/../../../Binaries/ThirdParty/DotNet/6.0.302/mac-x64
Running dotnet Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll Development Mac -Project=/Users/yahya/Documents/Unreal Projects/MyProject2/MyProject2.uproject -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Log file: /Users/yahya/Library/Application Support/Epic/UnrealBuildTool/Log.txt
Creating makefile for MyProject2Editor (no existing makefile)
Total execution time: 2.07 seconds
Platform Mac is not a valid platform to build. Check that the SDK is installed properly and that you have the necessary platorm support files (DataDrivenPlatformInfo.ini, SDK.json, etc).