---
title: Easiest way to delete node_modules folder
description: >-
  Quick and easiest way to remove node_module folders from the file system. Works all the time -
  100%, no extra other packages are required.
url: https://expiredqueues.com/delete-node-modules-folders/
date: '2015-12-07T21:55:29.000Z'
image: https://expiredqueues.com/images/og/delete-node-modules-folders-246796d8.jpg
---

Written in December 2015. Much of what it describes has since changed or disappeared; it is kept as a record of how the web used to work, not as advice.

Tutorials posts gulp

# How to: delete node\_modules folders in windows.

7 December 2015 By Adrian 1 min read

Let us agree, we all have been there once in a while, messing up our hair while removing these long path issues with node\_modules.

For a while, I used to copy paste nested npm folders outside and try deleting again and again until I delete them all. I googled around and found a few other tricks that do the job fairly, but after being so used to the Node workflow, I happen to find the easiest way. So here is what you have to do.

## Enter [npm prune](https://docs.npmjs.com/cli/prune)

All you got to do is remove the node\_module listings from your package json and then run \`npm prune\`

Let's say your package.json looks like this:

![Screen Shot 2015-12-08 at 3.25.55 AM](https://expiredqueues.com/images/opt/Screen-Shot-2015-12-08-at-3.25.55-AM-320.jpeg)

Remove everything or maybe just any particular npm which you wish to remove. Take an example, we wanted to remove all of it - then I would simply empty the dependencies like:

![Screen Shot 2015-12-08 at 3.27.40 AM](https://expiredqueues.com/images/opt/Screen-Shot-2015-12-08-at-3.27.40-AM-320.jpeg)

Then run "npm prune" and voila. NPM will unbuild all of the node\_modules folder which it didn't find in the package.json but did locate in the drive.

[Previously Fix iTerm2 word navigation on macOS](https://expiredqueues.com/iterm2-mac-natural-text/) [Next On the verge of MNC life](https://expiredqueues.com/on-the-verge-of-mnc-life/)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "How to: delete node_modules folders in windows.",
  "datePublished": "2015-12-07T21:55:29.000Z",
  "dateModified": "2015-12-07T21:55:29.000Z",
  "author": {
    "@type": "Person",
    "name": "Adrian",
    "url": "https://expiredqueues.com/about/"
  },
  "publisher": {
    "@type": "Person",
    "name": "Adrian"
  },
  "mainEntityOfPage": "https://expiredqueues.com/delete-node-modules-folders/",
  "image": "https://expiredqueues.com/images/2015/Screen-Shot-2015-12-08-at-3.25.55-AM.png",
  "keywords": "posts, gulp, nodejs, npm, windows, workflow",
  "articleSection": "Tutorials"
}
```
