Skip to content

Is it safe to delete node_modules?

A JavaScript project's installed dependencies, which its package manager can install again.

Usually safe

It can be recreated, but it takes a download, a reinstall or the tool's own command.

~/**/node_modules

  • Only next to package.json
  • Never inside ~/Library, ~/**/lib/node_modules

What it is

Every Node.js project keeps the packages it depends on in a node_modules folder next to its package.json file. These folders can take hundreds of megabytes each, and they stay behind in projects you no longer work on. The packages can be installed again from the project's package.json and lock file.

If it's removed

The project won't run or build until its dependencies are installed again, which downloads them unless they're in a package manager's cache. Changes made directly to files inside node_modules are lost.

How it's removed

Moved to the Trash, where you can restore it.

PRO

The free analyzer finds it and explains it. Removing it is Pro, after a review sheet that lists every move and command. It's never checked for you: it waits for your choice.

Sources

Last checked on 27 Sep 2026. Every entry is written and checked by hand; the app and the command-line tool use the same words.