# Is it safe to delete node_modules folders?

- URL: https://moreroom.app/folders/project-node-modules
- Item: node_modules folders
- Location: `…/node_modules`
- Verdict: Safe to remove — Rebuilt or re-downloaded automatically when needed.
- Comes back on its own: yes
- Typical size: 100 MB–2 GB per project
- Source: MoreRoom rules catalogue (2026-10-17), by Yando Pte. Ltd.

## What is it?

A `node_modules` folder holds the packages a JavaScript or TypeScript project installed with npm, Yarn, pnpm or Bun. Only folders next to a lockfile (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `bun.lock` or `bun.lockb`) in projects not touched for 30 days are considered, so the exact versions can be restored. Each one is typically 100 MB to over 1 GB.

## What happens if you delete it?

Running `npm install` (or `npm ci`, `yarn`, `pnpm install`, `bun install`) in the project rebuilds the folder from the lockfile, which takes a minute or two and some bandwidth. Your source code is not affected.

## How to remove it properly

Move the `node_modules` folder to the Trash in Finder, or run `rm -rf node_modules` in the project folder (permanent). Tools such as `npx npkill` list them across all projects.

## Before you delete it

If you edited files inside `node_modules` by hand (a local patch without `patch-package`), those edits are lost.
