Created
September 17, 2021 06:37
-
-
Save mojavelinux/4bfc2ff1b41fa86a336ea83be672b549 to your computer and use it in GitHub Desktop.
Shows where Node.js is looking to find a module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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