简体   繁体   English

使用节点软件包管理器,为什么会安装许多不需要的模块?

[英]Using node package manager, why might it install many unwanted modules?

I'm looking to use Gulp and a few plugins. 我正在寻找使用Gulp和一些插件。 The package.json lists the dependencies correctly, but if I do npm install locally my node_modules folder gets filled to the brim. package.json正确列出了依赖项,但是如果我在本地进行npm install ,我的node_modules文件夹将被填充到边缘。 If I try to install a single package locally, node_modules ends up including more than 60 other folders. 如果我尝试在本地安装单个软件包,则node_modules最终会包含60多个其他文件夹。

This is because each dependancy described in package.json are themselves modules which have other module dependancies. 这是因为package.json中描述的每个依赖关系本身就是具有其他模块依赖关系的模块。 So the whole tree gets pulled in when you install the module dependancies. 因此,当您安装模块相关性时,整个树会被拉入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM