When trying to compile UE I get an error (Magic number is wrong)

I downloaded the latest release from github as a .tar.gz file, extracted it and tried to run Setup.sh
This is what I get:

[j@j UnrealEngine-4.18.3-release]$ sh ./Setup.sh   Github build Checking / downloading the latest archives   Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Console' threw an exception.
---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.Exception: Magic number is wrong: 542   at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& position) [0x00028] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.TermInfoDriver..ctor (System.String term) [0x00055] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.ConsoleDriver..cctor () [0x0004d] in <a84b655e5e6a49ee96b338ec792f5580>:0  
--- End of inner exception stack trace ---   at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.Console..cctor () [0x0008e] in <a84b655e5e6a49ee96b338ec792f5580>:0  
--- End of inner exception stack trace ---   at GitDependencies.Program.Main (System.String[] Args) [0x005bc] in <e6e5dda5eebb4ce3b77e460f8828bf9c>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Console' threw an exception.
---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.Exception: Magic number is wrong: 542   at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& position) [0x00028] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.TermInfoDriver..ctor (System.String term) [0x00055] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.ConsoleDriver..cctor () [0x0004d] in <a84b655e5e6a49ee96b338ec792f5580>:0  
--- End of inner exception stack trace ---   at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <a84b655e5e6a49ee96b338ec792f5580>:0   at System.Console..cctor () [0x0008e] in <a84b655e5e6a49ee96b338ec792f5580>:0  
--- End of inner exception stack trace ---   at GitDependencies.Program.Main (System.String[] Args) [0x005bc] in <e6e5dda5eebb4ce3b77e460f8828bf9c>:0 Result: 1

I am on arch linux in case that is relevant.

This is an issue with mono on your system, not an issue with Unreal. You are on Arch, so you are probably using the latest version of mono, and it looks like it have that bug: https://github.com/mono/mono/issues/6752 . Thread suggested using a workaround of setting TERM=xterm, please try doing that before running Setup.sh.

Hello,

I’m searched for HOURSSSSS to solve the pb…
Thought it was the clang version witch was bad.

Fortunately, I found your answer and…no more error !
It’s curently checking and updating dependencies, hope I can go to the end of the install !

Thank you very much !!!

//Mangoro 17.1.6 - deepin//