处理重复的 npm 包 [英] handling duplicate npm packages
问题描述
我有安装相同 npm 包的子模块.他们的节点模块安装与 repo 中的其他节点模块相同的 npm 包.如何将所有 npm 包合并到一个 package.json 文件中,以免安装重复的包?
I have submodules that install the same npm packages. Their node modules install same npm packages as other node modules in the repo. How can i consolidate all of the npm packages into one package.json file so that there are no duplicate packages installed?
推荐答案
@slebetman 是正确的.库可能共享依赖项,但它们可能会使用每个库的不同版本.此外,无耻地插入 非常类似的问题我回答了一段时间之前有人问为什么不全局安装依赖项,这样我们就不必一遍又一遍地重新安装我们已有的东西?"
@slebetman is correct. Libraries may share dependencies, but they will likely use different versions of each. Also, shameless plug to a very similar question I answered a while back where someone was essentially asking "Why not install dependencies globally so we don't have to reinstall over and over what we already have?"
在此处回答.
这篇关于处理重复的 npm 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!