How do I console.log()
from dependencies in node_modules
in my node project? I'm using the default create-react-app
setup.
When I include console.log()
in my application code, logging works fine. However, when I try to include console.log()
in the code of one of the project's dependencies in node_modules
, these do not appear in my console.
Any way I can get those logs?
If you are monkey patching an npm module with a console.log() to debug an issue it should show up just like any other console statement would. It's probable that your root cause is your build. I'm making some assumptions that you are using babel and a bundler tool like Webpack.
BABEL_DISABLE_CACHE=1 webpack
Alternatively I'd personally recommend you reconsider your approach. While I've actually done this a couple times; if you are adding "debugging" like this to lower level modules you are probably looking in the wrong place for your issue unless there is a legit bug in the lib...