I finally found out where the problem is.
Not sure when or how long ago, I might backup my node_modules into ~peertube which contains node 17.4.0 in it. So it seems to get the version there. I removed it and then could use node 20 successfully.
For your reference.