`ReferenceError: primordials is not defined` on Node 12

I got this error running Tramway in a node:latest container:

./node_modules/.bin/tramway start
fs.js:27
const { Math, Object, Reflect } = primordials;
                                  ^
ReferenceError: primordials is not defined
    at fs.js:27:35
    at req_ (/www/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/www/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/www/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)

As you can see the stack trace doesn't implicate my code, nor Tramways, which makes this difficult to debug.

I ended up googling "const { Math, Object, Reflect } = primordials;" and that's how I found: https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node

So now I use node:10 instead of node:latest and everything works.

Still, I thought I'd post here to help others going through the same thing and noticing that the problems occurs during tramway start. They might search this repo and find this issue, downgrade node and solve their problem :)

Apparently (from the same stackoverflow thread), there is another better solution which doesn't involve downgrading Node, and that is to upgrade to Gulp 4 (#1 (closed)), so consider this a vote for that enhancement as well.

Assignee Loading
Time tracking Loading