“node_modules”文件夹大小太大

huangapple go评论112阅读模式
英文:

node_modules folder size way to big

问题

I recently created a new next app just for checking the size of node_modules and it has a size of 320mb which it can increase. Is that a normal thing, or i have to be aware of something?

这是我最近创建的一个新的Next.js应用程序,只是用来检查node_modules的大小,它的大小是320MB,而且可能会增加。这是正常的吗,还是我需要注意什么?

Does it have anything to do with the node version?

这与Node.js版本有关吗?

英文:

I recently created a new next app just for checking the size of node_modules and it has a size of 320mb which it can increase. Is that a normal thing, or i have to be aware of something?

Does it have anything to do with the node version?

答案1

得分: 0

这是完全正常的。我正在构建一个新的博客,它已经达到了437MB。它们达到1GB并不常见。

“node_modules”文件夹大小太大

英文:

That is completely normal. Am building a Next blog, and it is already at 437 MB. It's not usual for them to reach 1GB.

“node_modules”文件夹大小太大

答案2

得分: 0

这在NPM世界中是一种正常现象。node_modules变得非常庞大的原因与包及其引用的存储方式有关。

假设您需要包A,但包A依赖于包BC。包B依赖于包CEF

您拉取的包C与所需的包A也依赖于包EFG

您能发现这种趋势吗?
使用NPM时,您可能会多次拉取相同的包。

> 我需要注意什么吗?

是的,只拉取您绝对需要的包。

英文:

It's a normal thing in the NPM world. The reason why node_modules can get absurdly huge has to do with how the packages and their references are stored.

Let's say that you need package A, but the package A depends on packages B and C. Package B depends on packages C, E, and F

The package C that you pulled with the needed package A also depends on packages E, F, and G.

Can you spot the trend here?
With the NPM, you may be pulling the same packages many (many) times.

> i have to be aware of something?

Yes, that is, only pull packages you absolutely need.

huangapple
  • 本文由 发表于 2023年6月9日 13:20:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76437408.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定