0

Is there a way to set a global search directory for entire node.js process, so all calls to require('module') (in any file) will try to load the requested module from the specified directory first?

I don't want to change the path to a node_modules directory or to rename it. I want to add another search location for node resolution algorithm, which will be looked up prior the node_modules.

Slava Fomin II
  • 26,865
  • 29
  • 124
  • 202
  • 4
    Possible duplicate of [Specify path to node\_modules in package.json](https://stackoverflow.com/questions/26293049/specify-path-to-node-modules-in-package-json) – Jake Holzinger Feb 04 '19 at 18:33
  • @JakeHolzinger this is not a duplicate. I've updated the question to specifically explain this. – Slava Fomin II Feb 04 '19 at 19:39

0 Answers0