Where is the node.js file in the stack trace located?
-
22-09-2019 - |
문제
Obviously, I'm pretty new to node.js. I'm attempting to debug a node.js application and I see node.js in the stack trace.
I would like to put some sys.puts
calls in there, but I cannot locate the node.js that is being run by my server.
Is there a way to tell where node.js is located? Is there an equivalent to Ruby's __FILE__
in node?
Thanks, Brian
해결책
It's hidden in the source together with C++ sources and headers at <node-installation>/src/node.js.
You can't modify node.js and expect changes to have a direct effect. After a change you have to rebuild with make. You also can't do many things, for example you have to use process.stdout.write() instead of sys.print().
Good luck!
제휴하지 않습니다 StackOverflow