node-dns icon indicating copy to clipboard operation
node-dns copied to clipboard

TypeError: Cannot read property 'unref' of undefined

Open kupson opened this issue 10 years ago • 1 comments

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

kupson avatar Jul 03 '15 15:07 kupson

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

Raju568 avatar Apr 13 '18 07:04 Raju568