ELECTRON_RUN_AS_NODE=1 breaks require('electron')

I’ve been trying to increase the memory limit of the renderer process as described here:

However, ELECTRON_RUN_AS_NODE=1 seems to break the ability to require electron entirely. In fact it makes require('electron') return a path like "/path-to-app-root/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron", not a module at all.

When I unset ELECTRON_RUN_AS_NODE everything runs as normal.