Menu

Post image 1
Post image 2
1 / 2
0

node_modules is Why Your Mac is Full: Find and Delete All of Them

DEV Community·Sergey Nikiforov·about 1 month ago
#MzC5Q6pp
Reading 0:00
15s threshold

I had 47 node_modules folders totaling 38GB on my Mac. Most of them were for projects I hadn't touched in months. A weekend tutorial from last year? Still has its node_modules. That side project I abandoned after two commits? node_modules. A cloned repo I opened once to read the source? You guessed it — node_modules. If your Mac keeps telling you the disk is full and you're a JavaScript developer, there is a very good chance that node_modules is the single biggest reason why. It's not your photos. It's not your music. It's 200,000 tiny files spread across dozens of forgotten project directories. Let's fix that. Why node_modules Gets So Absurdly Big If you've ever looked at a fresh node_modules folder and wondered how a project with three dependencies ended up with 900MB of installed packages, you're not imagining things. There are real structural reasons why this happens. Flat Dependency Trees npm v3 introduced flat dependency trees to solve the deeply nested paths problem on Windows. The trade-off?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More