question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

remove() doesn't delete a subfolder inside my project folder. What is wrong here ?

See original GitHub issue
  • Operating System: Win 10 64 bit
  • Node.js version: 8.7.0
  • fs-extra version: 5.0.0

I am trying to delete a non-empty subfolder which is inside my project directory but i can’t seem to delete it with fs.remove(folderPath). The code runs with no errors but the folder is still there and i can’t even delete it manually unless i first empty the folder and delete all the files in there. I get a permission related error when i try to directly delete the folder even though i am the owner/admin. Could it be a permissions related issue ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18

github_iconTop GitHub Comments

2reactions
mojavelinuxcommented, Jan 26, 2018

I’m seeing a similar problem on Windows. Every now and again in the test suite, it fails to remove a directory because it claims the directory is not empty. But when the process completes, the directory is gone. So could it be that there’s a race condition or that it’s a false warning?

Error: ENOTEMPTY: directory not empty, rmdir ...
at Object.fs.rmdirSync (fs.js:846:18)
at rmkidsSync (node_modules\fs-extra\lib\remove\rimraf.js:304:27)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix "You have to delete all the items in this folder before you ...
This PowerShell script deletes all files and sub-folders of the given folder in SharePoint Online using the Remove-PnPListItem cmdlet.
Read more >
[Solved] Unable to Delete a Folder In Windows 10 - mulcas
Solution · Option 1: Restart Windows File Explorer · Option 2: Remove the folder using Windows Command-line · Option 3: Rename the folder...
Read more >
Why I can't delete a folder? - Ask Ubuntu
Try cd into the directory, then remove all files using rm -rf * . Then try going out of the directory and use...
Read more >
c# - Cannot delete directory with Directory.Delete(path, true)
I ran into this problem before. The root of the problem is that this function does not delete files that are within the...
Read more >
You have to delete all the items in this folder before you can ...
Having me spend hours deleting files one by one is a lousy design. Give us the ability in One Drive for Business to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found