I am not sure what you want to achieve (and I ignore the intent of upstream) but I noticed that the build-modules.js script looks at the last argument in the command line to select the target it should copy the files to
so for example if I create a directory: mkdir dist/q then passing this as last argument to the command line: nodejs lib/main/build-modules.js dist/q will not cause the error