Firebase Emulator fails at startup Cannot find module --dns-result-order=ipv4first
Asked Answered
F

4

11

The firebase emulator 11.0.0 is failing to start

firebase emulators:start

an Exception is thrown when it gets to Emulator UI...

i ui: Emulator UI logging to ui-debug.log
⚠ ui: Fatal error occurred: Emulator UI has exited with code: 1, stopping all running emulators
i ui: Stopping Emulator UI
⚠ ui: Error stopping Emulator UI

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

node:internal/modules/cjs/loader:936 throw err;

Error: Cannot find module '/Users/hayden/Desktop/parent_app_firebase_cloud_emulator/functions/--dns-result-order=ipv4first'.
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15).
at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46). at Function.Module._load (node:internal/modules/cjs/loader:778:27).
at Function.runMain (pkg/prelude/bootstrap.js:1983:12).
at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }.

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 on how to startup the local firebase emulator so it runs without failing with this exception?

Running Node 16 and Firebase 11.0.0

Fraudulent answered 20/5, 2022 at 3:6 Comment(5)
only solution I've found is to revert to Firebase 10.9.2 Please comment/vote if anyone else has the same issue and I'll post the bug on their repoFraudulent
Exactly the same. Downgrading firebase cli from 11 to 10.9.2 does the trick for me. Using node 16Northward
Execute "npm i [email protected]" to install the version where this issue is not reproducibleMisconstruction
Related issue: github.com/firebase/firebase-tools/issues/4566Misconstruction
You should post the content of those images as copy-pastable text, instead of images. This is likely why the question was closed and left closed in reviewOutfoot
F
7

This bug still exists but thanks to the github link provided by @Viktor the firebase team have located the issue and provided a temporary work-around...

Issue source: standalone Firebase CLI binary

Solution: remove the standalone binary & re-install with npm...

Step 1. locate firebase standalone binary..

which firebase

prints something like... /usr/local/bin/firebase

Step 2. rename or delete this folder...

sudo mv /usr/local/bin/firebase /usr/local/bin/firebase_broken

Step 3. reinstall using npm

 npm install -g firebase-tools

Step 4. Good to go! re-run from project folder...

firebase emulators:start
Fraudulent answered 24/6, 2022 at 8:39 Comment(0)
E
3

Downgrading to 10.9.2 fixes the issue for me:

npm i -g [email protected]
Extent answered 25/5, 2022 at 19:32 Comment(0)
B
2

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

sudo npm i -g [email protected] --force
Berga answered 7/6, 2022 at 17:12 Comment(0)
B
0

for Mac os, removing firebase cli installed through curl command and using brew instead works fine:

#for uninstalling previous cli package
curl -sL firebase.tools | uninstall=true bash

#new installation using brew command
brew install firebase-cli
Bosom answered 12/8, 2024 at 3:23 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.