diff options
Diffstat (limited to 'deps/npm/node_modules/npm-package-arg/npa.js')
-rw-r--r-- | deps/npm/node_modules/npm-package-arg/npa.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/deps/npm/node_modules/npm-package-arg/npa.js b/deps/npm/node_modules/npm-package-arg/npa.js index 8989049ec8..1e6deb1ec7 100644 --- a/deps/npm/node_modules/npm-package-arg/npa.js +++ b/deps/npm/node_modules/npm-package-arg/npa.js @@ -122,7 +122,7 @@ function parseLocal (res, arg) { throw new Error("Invalid Path: " + JSON.stringify(arg)) } res.type = "local" - res.spec = path.resolve(arg) + res.spec = arg } function parseUrl (res, arg, urlparse) { @@ -162,7 +162,13 @@ function parseUrl (res, arg, urlparse) { case "file:": res.type = "local" - res.spec = urlparse.pathname + if (isWindows && arg.match(/^file:\/\/\/?[a-z]:/i)) { + // Windows URIs usually parse all wrong, so we just take matters + // into our own hands, in this case. + res.spec = arg.replace(/^file:\/\/\/?/i, '') + } else { + res.spec = urlparse.pathname + } break default: |