Skip to content

fs: passing '~' to realpathSync causes error in the REPL #36493

@RaisinTen

Description

@RaisinTen

What is the bug?

Every time in the REPL:

> console.log(require('fs').realpathSync('~'));
Uncaught:
Error: ENOENT: no such file or directory, lstat '/home/raisinten/Desktop/universe/temp/project/~'
    at Object.realpathSync (node:fs:1753:7) {
  errno: -2,
  syscall: 'lstat',
  code: 'ENOENT',
  path: '/home/raisinten/Desktop/universe/temp/project/~'
}

What is the expected behavior?

> console.log(require('fs').realpathSync('~'));
/home/raisinten
undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.pathIssues and PRs related to the path subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions