Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

path.normalize() differences introduced in 20.18.2 #57243

Open
kelleyma49 opened this issue Mar 1, 2025 · 0 comments
Open

path.normalize() differences introduced in 20.18.2 #57243

kelleyma49 opened this issue Mar 1, 2025 · 0 comments

Comments

@kelleyma49
Copy link

Version

20.18.2

Platform

Windows

Subsystem

No response

What steps will reproduce the bug?

It looks like the :\ passed to path.normalize() causes the function to add a .\. I believe it's related to this commit: 8306457. This might be intended behavior, but has the potential for functions that spawn or fork execs would break because of this change.

Here's a repro:

nvm use 20.11.1 ; node -e "const path = require('path'); console.log(path.normalize('powershell.exe echo \':\\hello!\''));" ; nvm use 20.18.2 ; node -e "const path = require('path'); console.log(path.normalize('powershell.exe echo \':\\hello!\''));"           
Now using node v20.11.1 (64-bit)
powershell.exe echo ':\hello!'
Now using node v20.18.2 (64-bit)
.\powershell.exe echo ':\hello!'

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

This behavior is observed if any part of the path passed to path.normalize() contains '.'

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

It is not expected that '.' is added.

What do you see instead?

See the repro steps for expected and changed output.

Additional information

No response

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant