Flat Tree Dependency Resolution in Npm v3
docs.npmjs.com
Flat Tree Dependency Resolution in Npm v3
1–10 of 123 posts
Re: Flat Tree Dependency Resolution in Npm v3
#2Though, if there are problems, I wonder - can the flat dep resolution be disabled using some CLI flag? Or when installing deps, or in .npmrc, or during a shrinkwrap?
Re: Flat Tree Dependency Resolution in Npm v3
#3Re: Flat Tree Dependency Resolution in Npm v3
#4Re: Flat Tree Dependency Resolution in Npm v3
#5Will this prevent node_modules/ from having 17 copies of the the same file in 17 different places?
Re: Flat Tree Dependency Resolution in Npm v3
#6I would also assume for very large apps it may improve startup time because you don't have to initialize and retain multiple copies of the same module.
Re: Flat Tree Dependency Resolution in Npm v3
#7Re: Flat Tree Dependency Resolution in Npm v3
#8But I wish they had aimed higher. The better goal would be that the entire state of the node modules directory is a pure function of the contents of the package.json file plus the platform details (compiler used for native modules).
While they're at it, the ecosystem could be improved considerably if there was some sort of obvious "penalty" applied to any package that compiles native code, because such things cause considerable extra trouble for Windows users. A visible penalty, transitively carried up the dependency tree, would discourage use of such modules with native code; projects would use them (depend on them) only if absolutely necessary instead of accidentally, all over, all the time.
Re: Flat Tree Dependency Resolution in Npm v3
#9Earlier quoted context omitted.
yes, as long as there aren't version conflicts.
Which there will be because everyone uses --save so each module has the version around when they added the module.
Re: Flat Tree Dependency Resolution in Npm v3
#10It's terrible practice, but it's not unheard of for an NPM module to monkey patch its dependencies, since before this the library could assume it had sole ownership of its whole subtree.