handling duplicate npm packages

不想你离开。 提交于 2021-02-10 06:53:49

问题


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?


回答1:


@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?"

Answered here.




回答2:


Had a nasty bug with NPM duplicating nested modules. Switching to Yarn helped. So try yarn install instead of npm install.



来源:https://stackoverflow.com/questions/38734039/handling-duplicate-npm-packages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!