I\'m using the Mac OS to install the XCode10.1.
I have 18.43GB free disk space in the mac,
but when I click the install button on the Xcode from the app store,<
TL;DR: Deleting XCode (~7GB) and then the folder Users/[insert your mac username here]/Library/Developer (~90GB) freed around 100GB. I then installed XCode off of the App Store and it worked like a charm.
The answers above, such as rm hugefile did not work for me because I guess I had a legit memory issue. Downloading the XCode file and manually installing did not work because I still got the space/memory error.
I had about 10GB of free space according to Disk Utility.
Deleting XCode (I had it prior but had to update it) and other applications brought me to 17-20GB.
Still didn't work.
I had to go into the Users/[insert your mac username here]/Library/Developer and I deleted that directory, which I guess somehow saved XCode crap even though I deleted the application.
That brought me to a stunning 120GB.
120GB.
That is half of the memory on my hard drive.
?!
No idea how that works.
I then installed XCode directly off of the App Store and it works like a charm.
I guess be careful because I am not sure what is in that directory.. It did not seem important and all seemed XCode-related. It looked like simulators for XCode and other XCode related stuff. I am not sure. I use XCode A LOT so maybe error logs or usage logs built up. Even then - that's just text. So I am not sure. If I run into any weird issues that might result, I will post it here, but so far nothing.
Also, I highly recommend OmniDiskSweeper, which is a free program and is how I figured this out (among other memory-related issues in the past)