help icon indicating copy to clipboard operation
help copied to clipboard

Node.js dont work ---> Error: EFILE at dns.js:249 "this._handle = new ChannelWrap();"

Open test-914029 opened this issue 9 years ago • 10 comments

  • Version: v8.6.0
  • Platform: Windows 8.1
  • Subsystem: Node.js

I just downloaded Node.js and installed it, but when I open node.exe it display this error and exits immediatelly. Does anyone could explain what causes it? How to fix this issue, what did i did wrong? Thanks!

dns.js:249
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:249:20)
    at dns.js:380:25
    at NativeModule.compile (bootstrap_node.js:595:7)
    at NativeModule.require (bootstrap_node.js:540:18)
    at net.js:46:13
    at NativeModule.compile (bootstrap_node.js:595:7)
    at NativeModule.require (bootstrap_node.js:540:18)
    at tty.js:25:13
    at NativeModule.compile (bootstrap_node.js:595:7)
    at NativeModule.require (bootstrap_node.js:540:18)

test-914029 avatar Nov 04 '17 15:11 test-914029

I think that's node telling you in a rather oblique way it can't initialize networking (no network configured or network down?)

Try the latest v8.x release and see if it fares better.

bnoordhuis avatar Nov 04 '17 15:11 bnoordhuis

Yes, on the computer where I test Node.js it doesn't have internet connection, but why it dont allow me to even start node? Do you want to say that Node requires internet in order to launch?

test-914029 avatar Nov 04 '17 16:11 test-914029

See https://github.com/nodejs/node/issues/8966. The answer to your question is essentially that no, node.js won't work when networking is completely disabled.

bnoordhuis avatar Nov 04 '17 17:11 bnoordhuis

Thank you for explaining. However, you said that

Node.js won't work when networking is completely disabled.

Why? I don't have any network drivers installed on my second computer, but I want to do some offline tests in Node.js, is there any way to achieve it? As I can see this error came from JavaScript environment, not c++, so is there a way to avoid loading dns.js and just use standard Node.js features?

test-914029 avatar Nov 04 '17 17:11 test-914029

No. It's in the issue I linked to.

bnoordhuis avatar Nov 04 '17 17:11 bnoordhuis

As per https://github.com/nodejs/node/issues/8966#issuecomment-318389243, you can try Node.js 9.0.0, it has ares 1.13.0

vsemozhetbyt avatar Nov 04 '17 18:11 vsemozhetbyt

@bnoordhuis @vsemozhetbyt Thank you for helping! Downloading Node.js version v9.0.0 solved the problem. Node.js now works properly. Feel free to close this issue if you want.

test-914029 avatar Nov 05 '17 21:11 test-914029

Hello, anyone can give me a sharp solution for this problem.

sohrabq avatar Oct 28 '18 19:10 sohrabq

dns.246: Error: efile bla bla bla

sohrabq avatar Oct 28 '18 19:10 sohrabq

I just simply restart my computer and it all work fine. My node version is 8.9.3

Jonexuan avatar Oct 17 '19 01:10 Jonexuan