← Back to Guides

How to Find and Delete Node Modules on Mac

•CheckMyDisk Editorial•3 min read

Finding and Deleting node_modules on Mac (2026)

If you're a web developer, you know the pain: you start a dozen side projects, run npm install, and abandon them a week later. Fast forward a year, and your Mac is entirely out of disk space.

The culprit? Gigabytes upon gigabytes of nested node_modules folders.

Because node_modules contain tens of thousands of tiny files, they don't just take up disk space—they also slow down Spotlight indexing and make Time Machine backups take forever.

Here are the best ways to hunt down and eliminate them.

Method 1: The Visual Approach (Recommended)

When you're trying to figure out which projects are taking up the most space, a visual map is infinitely better than a terminal output.

Using a native tool like CheckMyDisk:

  1. Open CheckMyDisk and click Scan Folder.
  2. Select your ~/Developer or ~/Documents folder (wherever you keep your projects).
  3. In seconds, CheckMyDisk will generate a beautiful map of your folder.
  4. The massive blocks will instantly reveal which abandoned projects have the heaviest node_modules.
  5. You can right-click the block and send it straight to the Trash.

Method 2: The Command Line (npkill)

If you live in the terminal and want to quickly nuke node_modules folders, npkill is an incredibly popular open-source tool.

  1. Open your Terminal.
  2. Navigate to your main developer directory (e.g., cd ~/Developer).
  3. Run the following command (you don't even need to install it permanently):
    npx npkill
    
  4. npkill will scan all subdirectories and present a list of every node_modules folder it finds, along with their sizes.
  5. Use your arrow keys to navigate the list, and press Spacebar to instantly delete a folder.

Tip: npkill is fantastic, but it only looks for node_modules. It won't help you find massive .git histories, stray Docker images, or giant .log files.

Method 3: Standard Terminal Commands

If you don't want to use npx, you can use the standard Unix find command to list all node_modules directories and their sizes.

Run this command in your terminal:

find . -name "node_modules" -type d -prune -print | xargs du -chs

This will print a list of paths and their sizes. You can then manually rm -rf the ones you no longer need.

Keep Your Drive Clean!

As developers, we generate a lot of digital debris. Regularly clearing out your node_modules, Xcode derived data, and unused Docker containers can keep your Mac running smoothly and give you the space you need for your next big project.

Ready to clean your Mac?

Download CheckMyDisk and free up gigabytes of wasted space in seconds.

Get CheckMyDisk for $7