0

I have some code which I am running in debug mode. As I understand it, this runs it through the standard node.js debugger.

I'm frequently getting the following:

...
break in timers.js:77
...

Sometimes I have breakpoints at other files, but they always give absolute file paths, but in this case its just the file name. I cannot find a file with that name which has the content listed on line 77, nor can I find an explanation of how the debugger works in regards to this.

How can I find this timers.js file?

Zach Lysobey
  • 14,959
  • 20
  • 95
  • 149
  • 1
    timers.js is a [core library](https://github.com/joyent/node/blob/v0.12.7/lib/timers.js) that's compiled in to the node binary. – josh3736 Jul 27 '15 at 23:30
  • Thanks @josh! "compiled in to the node binary" <-- meaning I can't access the source on my local machine? So... safe to assume that *all* files with non-absolute paths here are core libraries? If you (or someone) wants to put this info into an answer I'd be happy to up-vote and accept. – Zach Lysobey Jul 27 '15 at 23:59
  • It is [possible](https://nodejs.org/api/vm.html) (though usually not normal) for non-builtin files to have no path. – josh3736 Jul 28 '15 at 00:04

1 Answers1

1

Generally, when you see filenames with no path in the debugger, it means that the file is one of the core libraries that are compiled in to the node binary.

If you want to dig in to source, make sure you're looking at the git tag that matches the version of node you're running.

The builtin files are:

  • assert.js
  • buffer.js
  • child_process.js
  • cluster.js
  • console.js
  • constants.js
  • crypto.js
  • dgram.js
  • dns.js
  • domain.js
  • events.js
  • freelist.js
  • fs.js
  • http.js
  • https.js
  • module.js
  • net.js
  • os.js
  • path.js
  • punycode.js
  • querystring.js
  • readline.js
  • repl.js
  • smalloc.js
  • stream.js
  • string_decoder.js
  • sys.js
  • timers.js
  • tls.js
  • tty.js
  • url.js
  • util.js
  • vm.js
  • zlib.js
josh3736
  • 139,160
  • 33
  • 216
  • 263