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.

removeSync() does not error if file to remove exists, but is not writable.

See original GitHub issue
  • Operating System:
    • macOS 11.3.1
    • Ubuntu 16.04.6 LTS
  • Node.js version:
    • 16.1.0
    • 16.0.0
    • 14.16.1
  • fs-extra version:
    • 10.0.0

Starting with fs-extra 10.0.0 on node 14.14+, failures to rm a file that exists, but is in an unwritable directory, fail silently. fs-extra 9.1.0 throws an error, and fs-extra on node 12 throw an error.

Note that fs.rm in node 14.14+ is documented to fail silently only if the force parameter is true and the file to delete does not exist.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rhwoodcommented, May 13, 2021

I just submitted nodejs/node#38683 as Node does have this bug also.

0reactions
RyanZimcommented, May 25, 2021

Closing as wontfix, since this is an upstream bug in Node. Node just merged a fix for this: https://github.com/nodejs/node/pull/38684; from what I can tell, we should expect that fix to land in Node v17.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to delete file using fs.removeSync() - node.js
Based on node.js documentation removeSync function not exist. For delete file use unlinkSync function like this: fs.unlinkSync(path). But I ...
Read more >
Node.js: fs-extra - npm
This module adds a few extra file system methods that aren't included in the native fs ... If the directory does not exist,...
Read more >
Understanding Deno's file system - LogRocket Blog
If you try to write to a file that does not exist, ... To remove files in Deno, use either the remove or...
Read more >
GlasgowGuideApp/node_modules/fs-extra/CHANGELOG.md ...
Fix bug in move() & moveSync() when source and destination are the same, ... option for readJsonSync() ; now does not throw filesystem...
Read more >
Node.js: fs-extra - File Transfer Service ... - CERN GitLab
ensureDir(dir, callback). Ensures that the directory exists. If the directory structure does not exist, it is created. Sync: ensureDirSync(). Example:.
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