node_modules/[module_name]/[version]
Then it would be flat and support multiple versions of the same module in a way that is completely deterministic and also fully deduplicated.
This new system is unnecessarily complex.
node_modules/[module_name]/[version]
Then it would be flat and support multiple versions of the same module in a way that is completely deterministic and also fully deduplicated.
This new system is unnecessarily complex.
I certainly agree that your suggestion simplifies file-system layouts. The tradeoff is that the complexity shifts to other parts of the system.
That said, I'm not a fan of the v3 approach. I'd have preferred a central package cache with a structure similar to your suggestion. I'd add that each package in the cache should have all of its dependencies resolved in its own /node_modules/ dir with symlinks. Unfortunately, I still can't see a nice way to handle peer dependencies. Peer dependencies require the ability to walk up the file system to resolve, which you can't do with symlinks.