'Firebase Emulator fails at startup Cannot find module --dns-result-order=ipv4first

Pulling my hair out here, bought a new mac m1 pro but can't get firebase working locally.

firebase emulators:start is failing when it gets to Emulator UI...

enter image description here

The stack trace from firebase-debug.log shows...

enter image description here

Looks like the error has something to do with line 84...

Starting Emulator UI with command {"binary":"node","args":["--dns-result-order=ipv4first"

Which then throw an error in node as its unable to find a module called --dns-result-order=ipv4first

Any ideas?

Running Node 16 and Firebase 11.0.0



Solution 1:[1]

Downgrading to 10.9.2 fixes the issue for me:

npm i -g [email protected]

Solution 2:[2]

Yes downgrading works. On Mac I had to execute following:

sudo npm i -g [email protected] --force

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 matchifang
Solution 2 Tyler2P