I\'ve run into a curious issue - apparently some Node.js module have so deep folder hierarchies that Windows copy command (or PowerShell\'s C
I don't think there's any great solution given your constraints, but here are some things that may help.
npm dedupe to optimize your directory hierarchy which may shorten some pathsnpm install --production to install without the development toolsnode_modules directory under your_project/node_modules/pkg_with_deep_deps that will allow them to have short enough paths but still work. So this would be your_project/node_modules/pkg_with_deep_deps/node_modules.
require should be able to find those properly at run time. You'll just need to clearly document what you have manually changed, why you have done it, and keep your own true dependencies accurately represented in package.jsonHere is a github issue discussion that elaborates on this problem in detail.