Getting invidious to run was a gigantic pain for me. It definitely consumed all my RAM and crashed my system at least once.
There are recommendations about the memory needed for compiling.
If you do not have enough RAM just use the docker image which is already precompiled.