20

In a node.js stack trace there are always two numbers, the line number then a : and another number. In the example below, the first line has faye-redis.js:153:36 and 153 is the line number in that file for where the error is occurring, but what does the number :36 mean?

node_modules/faye-redis/faye-redis.js:153:36 • publish.notify
node_modules/faye-redis/faye-redis.js:72:16 • clientExists
node_modules/redis/index.js:532:9 • try_callback
node_modules/redis/index.js:614:13 • return_reply
node_modules/redis/index.js:266:14 • RedisClient.init_parser
events.js:96:17 • EventEmitter.emit
node_modules/redis/lib/parser/hiredis.js:43:18 • execute
node_modules/redis/index.js:488:27 • on_data
node_modules/redis/index.js:82:14 • none
events.js:96:17 • EventEmitter.emit
net.js:397:14 • onread
1
  • Did the existing answer from Niels answer your question? If so, can you accept it as the answer? Feb 22, 2022 at 15:45

1 Answer 1

23

The first number is the row (line number), the second is the column (character on line). In Javascript many coders habitually nest a lot of code on a single line with closures et al, or use minifiers like YUI compressor, so it's often rather relevant information.

3
  • 3
    And not only in JavaScript, but numerous other languages too. The line:column convention is a common occurrence in stack traces.
    – BoltClock
    May 3, 2013 at 19:37
  • One gotcha: If you're using tabs for indentation the column number reported by your editor may not match up to the character number reported. e.g., Sublime Text reports my tabs as two columns each.
    – RobW
    Sep 19, 2014 at 20:03
  • This should be the accepted answer. Feb 22, 2022 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.