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

path.resolve not normalizing paths in Node 23 #55448

Closed
steveluscher opened this issue Oct 18, 2024 · 1 comment
Closed

path.resolve not normalizing paths in Node 23 #55448

steveluscher opened this issue Oct 18, 2024 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@steveluscher
Copy link

steveluscher commented Oct 18, 2024

Version

v23.0.0

Platform

Linux {HOSTNAME} 5.15.0-117-generic #127-Ubuntu SMP Fri Jul 5 20:13:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Welcome to Node.js v23.0.0.
Type ".help" for more information.

require('path').resolve('/tmp/jest-changed-files-test-dir/nested-dir/second-nested-dir', '../../')
'/tmp/jest-changed-files-test-dir/'

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

Always.

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

The trailing slash should be stripped, as noted in the docs:

The resulting path is normalized and trailing slashes are removed unless the path is resolved to the root directory

Indeed the example in the docs themselves does not materialize in Node 23.

path.resolve('/foo/bar', '/tmp/file/');
// Returns: '/tmp/file'

It actually returns /tmp/file/.

What do you see instead?

The trailing slash is not stripped.

Additional information

No response

@avivkeller avivkeller closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2024
@avivkeller avivkeller added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Oct 18, 2024
@avivkeller
Copy link
Member

Duplicate of #55410

@avivkeller avivkeller marked this as a duplicate of #55410 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

2 participants