Skip to content

File Explorer takes a long time to delete node_modulesΒ #21

Open
@nmoinvaz

Description

@nmoinvaz

Environment

Item Value
OS, Version / Build 10.0.19041.0 Microsoft Windows NT 10.0.19041.0
Processor Architecture AMD64
Processor Type & Model Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz, 3192 Mhz, 6 Core(s), 12 Logical Processor(s)
Memory 32GB
Storage Type, free / capacity (e.g. C: SSD 128GB / 512GB) SSD 2TB
Relevant apps installed Node.JS / NPM

Description

When working on a project that utilizes package manager npm, it creates a node_modules directory that contains at least 100,000 files. On larger projects it can be even more. Deleting the node_modules directory from File Explorer takes a long time, and some times it goes through capturing all the information about the files and fails on some further steps.

nodemodules4

Often times File Explorer is the first way that users and developers go to delete files. Only after File Explorer fails do they then have to result to a command prompt. It is quite annoying to have to drop to a command prompt just for this folder. I know I can't be the only developer who experiences this problem.

For a comparison, this is how long it takes to delete the folder on macOS:

nodemodules3

I realize that both operating systems do different things behind the scenes, but it is unlikely that I can believe that nothing can be done to improve the experience with deleting folders that have lots of files.

Steps to reproduce

  1. Must have npm project already (you can try CRA for example)
  2. npm run install
  3. Open file explorer and delete node_modules

Expected behavior

It should not take so long to delete all the files.

Actual behavior

It takes a significant amount of time. File Explorer goes through various steps of calculating time, etc, after which it presents an UAC dialog, and then another permissions dialog at which point I end up just canceling.

Suggestions

  • It should recognize that the folder has many files and present an option to the user asking if they want "quick delete" the folder because it has too many files. In this instance File Explorer might choose to not notify all other apps that each individual file is being deleted, only that the main directory is being deleted.
  • Delete the folder immediately, and notify all apps of file deletes in the background.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions