The legacy seems not necessary. I can run the whole installation under ubuntu 20 under Mac parallel with
sudo apt-get install --yes git npm nodejs libnode64
Not sure whether it can be install under Mac?
Further, not sure how to run test.js (given it need windows in the error message, somehow you need a browser to run it?