'How can I include packages from multiple node_modules folders?

I have a server in which I would like to use to host different dashboards on. The problem is that I do not have the ability to modify the node_modules folder that the server is utilizing. The only option i see available is to have a separate node_module folders for each dashboard

is there a way that i can reference my separated, local node_module folders using the require() node function?

is it as simple as: require(__dirname + "/dash1/node_modules/body-parser") for example if i'd like to use the body-parser package for my dash1 dashboard?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source