Skip to content

fs.rmSync() cannot remove broken symbolic link #61020

Description

@Yuchen-Dai

Version

v24.12.0

Platform

Microsoft Windows NT 10.0.22631.0 x64

Subsystem

No response

What steps will reproduce the bug?

fs.rmSync() fail to remove broken symlinks.
The same operation works correctly in Node.js 22 and earlier.

How often does it reproduce? Is there a required condition?

Everytime
Only happens when:

  1. The symlink target does not exist
  2. Using rmSync (rm works correctly)

What is the expected behavior? Why is that the expected behavior?

fs.rmSync() should remove the symlink even if it's broken

What do you see instead?

rmSync fails silently, and the broken symlink remains on disk.

Additional information

Not sure if it is related to #58768

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions