About nodejs Debugging?

  node.js, question

Today, learning nodejs in seven days encountered the following program, and then the following problems occurred (the problem has been solved now, so I would like to ask about debugging problems):

//source code
 var fs = require('fs');
 function copy(src, dst) {
 fs.writeFileSync(dst, fs.readFileSync(src));
 function main(argv) {
 copy(argv[0], argv[1]);
 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
 TypeError: path must be a string
 at TypeError (native)
 at Object.fs.openSync (fs.js:500:18)
 at Object.fs.readFileSync (fs.js:352:15)
 at copy (/home/quoniam/node/app.js:4:30)
 at main (/home/quoniam/node/app.js:8:5)
 at Object.<anonymous> (/home/quoniam/node/app.js:11:1)
 at Module._compile (module.js:460:26)
 at Object.Module._extensions..js (module.js:478:10)
 at Module.load (module.js:355:32)
 at Function.Module._load (module.js:310:12)

I wanted to debug, so I found the 500th line of fs.js (under node’s lib directory) file and wanted to debug.
I tried two methods:
The first is to add console.log(path) to the fs.js file.
The second is to add debugger to the fs.js file.

However, the above two methods can’t locate the wrong line of fs.js file quickly, so I would like to ask you, Da Da, how can I debug fs.js file, that is, how can I locate fs.js file quickly?

Find an IDE—— with debugging function-I don’t know what it is, because I usually use console.log. I can probably locate according to the message and write console.log to find it.