Skip to content
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

realpathSync to realpathSync.native #5

Closed
privatenumber opened this issue Apr 20, 2022 · 3 comments · Fixed by #6
Closed

realpathSync to realpathSync.native #5

privatenumber opened this issue Apr 20, 2022 · 3 comments · Fixed by #6

Comments

@privatenumber
Copy link

In Windows, doing fs.realpathSync(os.tmpdir()) doesn't resolve the symlink. You must do fs.realpathSync.native(os.tmpdir()).

However, I'm not sure if it is always safe to use: nodejs/node#39721

@sindresorhus
Copy link
Owner

In Windows, doing fs.realpathSync(os.tmpdir()) doesn't resolve the symlink.

Sounds like this should be fixed in Node.js instead.

@privatenumber
Copy link
Author

As I understand it, fs.realpathSync.native is the fix to fs.realpathSync.

The promise version fsPromises.realpath(path[, options]) behaves like fs.realpathSync.native, and there is no promise version of fs.realpathSync.

@privatenumber
Copy link
Author

Thanks @Richienb

I recommend testing in Windows too moving forward as this issue was surfaced as a result of Window's specific behavior.

@Richienb Richienb mentioned this issue Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants