Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant call firebase at all, always returns TypeError: dns.setDefaultResultOrder is not a function #4580

Closed
readyiman opened this issue May 21, 2022 · 9 comments · Fixed by #4587
Assignees

Comments

@readyiman
Copy link

[REQUIRED] Environment info

firebase-tools: 11.0.0

Platform: Windows

[REQUIRED] Test case

npm update from version 10.9.2

[REQUIRED] Steps to reproduce

npm update from version 10.9.2

[REQUIRED] Expected behavior

Can call firebase

[REQUIRED] Actual behavior

Any firebase call returns to this:

C:\Users\Redi\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\portUtils.js:9
dns.setDefaultResultOrder("ipv4first");
^

TypeError: dns.setDefaultResultOrder is not a function
at Object. (C:\Users\Redi\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\portUtils.js:9:5)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object. (C:\Users\Redi\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\registry.js:6:19)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)

@readyiman
Copy link
Author

Solved by updating node to v16.15.0 LTS (was 16.something before).
I'll keep this open, because firebase didn't say this as minimum requirement.

@timstoute
Copy link

I'm still seeing this error even though I'm on node v16.15.0 LTS. Any other changes that you made @readyiman ?

@bkendall bkendall self-assigned this May 23, 2022
@readyiman
Copy link
Author

@timstoute I'm pretty sure I didn't do anything else. Just download node from it site then just install it. Maybe, just maybe, had you try npm audit fix on your firebase folder? (honestly, I'm still wondering why for every firebase npm install always has vulnerabilities and need this audit fix thing).

@bkendall
Copy link
Contributor

Our minimum node requirement is in our package.json (which should be enforced by the CLI as well), but this made me realize that >=14.17.0 isn't quite enough, >=16.4.0 should be there to make sure setDefaultResultOrder is included in node 16 installations (even though 16.4 is fairly old.

I'd ask @readyiman - how had you installed the CLI and node? I don't have a good windows flow myself, so it's hard for me to test and verify fixes sometimes. :)

@readyiman
Copy link
Author

I'd ask @readyiman - how had you installed the CLI and node? I don't have a good windows flow myself, so it's hard for me to test and verify fixes sometimes. :)

Just casual one. I install node directly from it site https://nodejs.org/en/, And I install CLI from npm npm install -g firebase-tools usually from vscode terminal (cmd) just like in doc https://firebase.google.com/docs/cli#windows-npm (btw it actually written minimum CLI is v14.18.0).

@NeelaThangaduraiPandi
Copy link

Solved by updating node to v16.15.0 LTS (was 16.something before). I'll keep this open, because firebase didn't say this as minimum requirement.

This works for me.

@gonzaleztroyano
Copy link

Hello.

Same issue here. In my case, Firebase on CloudShell:

user@cloudshell:~$ firebase
/usr/local/nvm/versions/node/v16.1.0/lib/node_modules/firebase-tools/lib/emulator/portUtils.js:9
dns.setDefaultResultOrder("ipv4first");
    ^

TypeError: dns.setDefaultResultOrder is not a function
    at Object.<anonymous> (/usr/local/nvm/versions/node/v16.1.0/lib/node_modules/firebase-tools/lib/emulator/portUtils.js:9:5)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/usr/local/nvm/versions/node/v16.1.0/lib/node_modules/firebase-tools/lib/emulator/registry.js:6:19)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)

As said before, looks solved upgrading node.js (I've upgraded to v16.15.0).

@Exac
Copy link

Exac commented May 25, 2022

$ node -v
v14.15.0
$ nvm use 14.18
Now using node v14.18.2 (npm v6.14.15)
$ npm run deploy

I found I had to increase my Node version from 14.15.0 to to 14.18.2, not 16.

@lfoliveir4
Copy link

Solved by updating node to v16.15.0 LTS (was 16.something before). I'll keep this open, because firebase didn't say this as minimum requirement.

This works for me on mac m1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants