Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    (1) This answer was given 9 years ago. (2) This doesn’t address the question of how to delete the deleting_node_modules directory at all. The question (which I’ll admit was unclear) indicated that common methods of deleting the directory were not working at all. Commented Sep 16, 2022 at 23:52
  • 1
    Note that with your proposed function, redirecting to the log file would be problematic if the function was given relative or absolute pathnames (i.e. if $file, and subsequently $new_name, contained slashes). Commented Mar 29, 2023 at 4:11
  • 1
    dude, this saved me hours of having to wait for a folder to be deleted before I could run a deployment. Genius solution! Commented Aug 4, 2023 at 17:31