I've stuck with the same problem and rechecked everything for couple of hours to make sure: I've made it just as said in docs for the "from the sources part".
The test build was bullseye Debian and I followed all the recommendations.
It seems that it's just an inaccuracy in documentation; it says exactly "Please always use latest Node LTS." but that's the problem itself: XO seems not to work with NodeJS 20.x (that is also LTS) with the exact same errors from this ticket.
So just keep in mind that "Please always use latest Node LTS." means really "use NodeJS 16.x or 18.x versions for now" or you will get the errors like these.