简体   繁体   English

为什么安装 npm 包会重新安装我所有的其他包?

[英]Why does installing an npm package re-install all my other packages?

I have this annoying issue where when I try to install a new package with npm it starts installing all my other packages, often breaking something and forcing me to reinstall my node modules.我有一个烦人的问题,当我尝试使用 npm 安装一个新包时,它开始安装我所有的其他包,经常破坏某些东西并迫使我重新安装我的节点模块。 What could be the problem and how could I fix this?可能是什么问题,我该如何解决这个问题?

在此处输入图片说明

It does not install all your other packages, what it does is it just installs all the dependencies in order to actually install the gatsby-source-contentful .它不会安装所有其他软件包,它只是安装所有依赖项,以便实际安装gatsby-source-contentful

You can see the dependencies of the package in the dependencies tab.您可以在依赖项选项卡中查看的依赖项。 Of course, those dependencies might have more dependencies so it's just a chain of installations and updates.当然,这些依赖项可能有更多的依赖项,所以它只是一个安装和更新链。

For example the gatsby-source-contentful package, there is a dependency called gatsby-source-filesystem which has a dependency on the file-type so that's why it tries to update that.例如gatsby-source-contentful包,有一个名为gatsby-source-filesystem的依赖项,它依赖于file-type ,这就是它尝试更新它的原因。

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

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