-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different runtime behaviour of fs.realpath vs fs.promises.realpath is very confusing #37737
Comments
FWIW
Do you want to open a PR? |
Well, if there is agreement that |
FWIW the reason the implementations differ was explained here: #15485 (comment)
|
This was an intentional decision. I'd be -1 to changing the current behavior of fs.promises.realpath |
What steps will reproduce the bug?
Have a project that was still using
promisify(fs.realpath)
and replace this withfs.promises.realpath
to clean it up thinking the runtime behaviour will be the same. But in reality there is different behaviour: on Windows,subst
drives will be resolved to their targets whenrealpath.native
is used and left untouched withrealpath
.How often does it reproduce? Is there a required condition?
Always when using
subst
drives on Windows. There are probably more differences.What is the expected behavior?
That the
fs
API is in sync with the non promised variant.fs.promises.realpath
should be a drop in replacement forpromisify(fs.realpath)
but notpromisify(fs.realpath.native)
. There should be afs.promises.realpath.native
.What do you see instead?
fs.promises.realpath
behaves likepromisify(fs.realpath.native)
The text was updated successfully, but these errors were encountered: