You should change the code to:
traceroute.trace('google.com', function (err,hops) {
if (err) throw err;
console.log(hops);});
This way you'll get an error message telling you why it failed.
On Sunday, August 11, 2013 12:55:01 PM UTC+2, Mattias Larsson wrote:
>
> Hi,
>
> When I'm running this example script I get "undefined"... What could be
> the problem? I have installed the npm package traceroute.
>
> traceroute = require('traceroute');
> traceroute.trace('google.com', function (err,hops) {
> if (!err) console.log(hops);});
>
>
> Copied from https://npmjs.org/package/traceroute
>
>
> Thanks in advance !
>
> Br,
> Mattias
>
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.