Fix 'require' for emscripten modules in nodejs

Fixes #2920