Hey there @Iwonder8787! Unreal Engine requires Xcode to be installed and ran at least once before you can use it on MacOS. You can find it on the Appstore. A thread with some users incurring the same issue even with a command to help it along if there’s any issues.
Disclaimer: Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.