tjfontaine / node-dns

Replacement dns module in pure javascript for node.js
MIT License
585 stars 154 forks source link

TypeError: Cannot read property 'unref' of undefined #98

Open kupson opened 9 years ago

kupson commented 9 years ago

Hi,

I spotted another bug in the module:

/.../node_modules/native-dns/lib/pending.js:166
    if (this._socket.unref) {
                    ^
TypeError: Cannot read property 'unref' of undefined
    at SocketQueue._unref (/.../node_modules/native-dns/lib/pending.js:166:21)
    at SocketQueue._onlisten (/.../node_modules/native-dns/lib/pending.js:189:8)
    at emit (events.js:104:17)
    at Socket.<anonymous> (/.../node_modules/native-dns/lib/utils.js:122:12)
    at Socket.emit (events.js:129:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1001:10)

Probably just replacing this line with:

if (this._socket && this._socket.unref) {

would help but there might be a better approach.

Kind Regards, Rafal Kupka

Raju568 commented 6 years ago

By doing these following steps i finally get rid out of this problem.

Upgrade your node version-- Step 1: Clear your cache: sudo rm -rf /var/lib/apt/lists/* Step 2: then update : sudo apt-get update Step 3: Facing any issue while updating do: sudo apt-get update -o Acquire::http::No-Cache=True then try again with : sudo apt-get update step 4: Switch it to newer version --- eg: nvm use 7 Step:5 Start your app.

Thanks Raju Vishwakarma