Skip to content

fs.realpathSync('') returns CWD #35403

Description

@drsm
$ node -v
v12.18.4

What steps will reproduce the bug?

$ cd /tmp
$ node -e "console.log(fs.realpathSync(''))"
/tmp

What is the expected behavior?

$ node -e "fs.realpath.native('', (e) => void console.log(e))"
[Error: ENOENT: no such file or directory, realpath ''] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'realpath',
  path: ''
}

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

    fsIssues and PRs related to file-system APIs and the fs module.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions