The NPM hierarchy is actually quite complex, and they worked hard to optimize it. The most that you lose here is the small disk space. If you really need to trim the package structure for your application, you can take a look at npm dedupe , which is built directly on npm and does exactly what you are asking for (combines duplicates as much as possible).
, node_modules, , node_modules . , , , , npm update, , , , . (.. NPM) npm dedupe, , .
, ( NPM ), node_modules , , node_modules . , package.json - (, :/).
, node_modules npm .