5
How Nodejs manages Packages.json in sub-folders?
You have your normal application but you have sub-modules that you want to have your own dependencies, how does Node manage it? It creates another one node_modules
and puts all the files back inside that sub-folder?
(Suppose it is an architecture error but...), in the hypothetical idea that they had two dependencies of the same version both in the top package and in the subpackage Packages they would have the same version replicated both in the node_modules
of the root stock as in node_modules
of sub-folders?
Example:
└─── MinhaAplicacaoDeExemplo
└───v1
│--- package.json
└─── node_modules
│ └─── lodash1.0
│
│
└─── sub-pasta-que-tem-os-proprios-modulos
│--- package.json
└─── node_modules
└─── lodash1.0
Have two versions of the same package on
package.json
is a long discussion that has been active in NPM: https://github.com/npm/npm/issues/5499– Sergio