Skip to content

path.join should not be used with file:\\ URL #11

@Moriarty47

Description

@Moriarty47

path.join should not be used with file:\\ URL, it's unreliable.

// Node.js v18
const path = require('path');
path.join('file:\\', process.cwd());
// 'file:\\C:\\Users\\xxx\\nodejs\\v18.xx'

// Node.js v24
const path = require('path');
path.join('file:\\', process.cwd());
// '.\\file:\\C:\\Users\\xxx\\nodejs\\v24.xx'
    ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions