You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the error message is mis-named. The error message should be:
There was an error: TypeError [ERR_INVALID_OPT_VALUE]: The value "google.com" is invalid for option "address"
but the error message is:
There was an error: TypeError [ERR_INVALID_OPT_VALUE]: The value "google.com" is invalid for option "hostname"
this will work:
constdns=require('dns');constgetDNSInfo=(host)=>newPromise(resolve=>{dns.lookup(host,(err,hostname,service)=>{console.log('dns resolved:',{hostname, service, err});resolve({err, hostname, service});});});getDNSInfo('google.com').then(v=>{console.log(v);}).catch(v=>{console.error('There was an error:',v)});
but this doesn't:
constdns=require('dns');constgetDNSInfo=(host,port)=>newPromise(resolve=>{dns.lookupService(host,port,(err,hostname,service)=>{console.log('dns resolved:',{hostname, service, err});resolve({err, hostname, service});});});getDNSInfo('google.com',80).then(v=>{console.log(v);}).catch(v=>{console.error('There was an error:',v)});
The text was updated successfully, but these errors were encountered:
The first argument to lookupService() should be an IP address,
and is named "address" in the documentation. This commit updates
the code to match the documentation and provide less confusing
errors.
PR-URL: #29040Fixes: #29039
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
I am on Node.js v12.6
I have this issue:
nodejs/help#2106
I think the error message is mis-named. The error message should be:
There was an error: TypeError [ERR_INVALID_OPT_VALUE]: The value "google.com" is invalid for option "address"
but the error message is:
There was an error: TypeError [ERR_INVALID_OPT_VALUE]: The value "google.com" is invalid for option "hostname"
this will work:
but this doesn't:
The text was updated successfully, but these errors were encountered: