I'm working on a plugin system for a Node.js library and I'm having a little bit of trouble trying to figure out where the "require" and "require.resolve" functions are looking for packages when running some tests. I keep getting errors such as:
Cannot find module 'plugin-name' from "index.jS"
I know that typically Node.js would look for "node_modules" directories all the way up the hierarchy, but since I'm doing some mocking on my tests things are not that straightforward, so it would be really helpful if I could print some logs or debugging info of the paths Node.js is trying to find packages in.
Any ideas?
Thanks in advance.