Skip to content

Instantly share code, notes, and snippets.

@mojavelinux
Created September 17, 2021 06:37
Show Gist options
  • Save mojavelinux/4bfc2ff1b41fa86a336ea83be672b549 to your computer and use it in GitHub Desktop.
Save mojavelinux/4bfc2ff1b41fa86a336ea83be672b549 to your computer and use it in GitHub Desktop.
Shows where Node.js is looking to find a module
const Module = require('module')
Module._resolveLookupPaths = new Proxy(Module._resolveLookupPaths, {
apply(target, self, args) {
console.dir(args[1].paths)
return target.apply(self, args)
}
})
require('name-of-module')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment