Reputation: 16851
I am a new to Node JS. I have included a module via npm install '<module_name>
. It was built correctly and there was no errors. Now, I wanted to debug it, so I placed a few console.log('some text')
in code blocks of the module to see if the code by passes that line. Anyway, none of the log statements were displayed.
I am wondering if I have to compile or something the modules after adding the log staements. Am I missing something here.
Upvotes: 6
Views: 5384
Reputation: 6491
For anyone coming here in the future, try console.error
instead of console.log
. For some decided reason or another, log
was being overriding by the library I was monkey fixing. Took me way too long to find the culprit.
Upvotes: 1
Reputation: 5707
Your console.log
statements are not being run, this could be caused by many things.
Assuming you have added the console.log
statements to the module code in the node_modules directory of your app..
src
and dist
directories and you have not edited the code that is actually being run? (this relates to needing to recompile, but editing the actual code that the module is running will be quicker and easier)I would make sure I had a console.log
statement in a part of the code guaranteed to be hit, just as a sanity check.
Upvotes: 5