diff --git a/lib/path.js b/lib/path.js index 5d69d2270fe..5fb6656dc4b 100644 --- a/lib/path.js +++ b/lib/path.js @@ -177,6 +177,9 @@ if (isWindows) { tail += '\\'; } + // Convert slashes to backslashes when `device` points to an UNC root. + device = device.replace(/\//g, '\\'); + return device + (isAbsolute ? '\\' : '') + tail; };