英文:
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并不常见。
英文:
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.
答案2
得分: 0
这在NPM世界中是一种正常现象。node_modules变得非常庞大的原因与包及其引用的存储方式有关。
假设您需要包A,但包A依赖于包B和C。包B依赖于包C、E和F。
您拉取的包C与所需的包A也依赖于包E、F和G。
您能发现这种趋势吗?
使用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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论