Close #1349 Delimit NODE_PATH with ; on Windows

This commit is contained in:
isaacs 2011-07-15 15:26:15 -07:00
Родитель 93899cb0cb
Коммит 448eab2587
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -235,7 +235,8 @@ in pseudocode of what require.resolve does:
If the `NODE_PATH` environment variable is set to a colon-delimited list
of absolute paths, then node will search those paths for modules if they
are not found elsewhere.
are not found elsewhere. (Note: On Windows, `NODE_PATH` is delimited by
semicolons instead of colons.)
Additionally, node will search in the following locations:

Просмотреть файл

@ -481,7 +481,8 @@ Module._initPaths = function() {
}
if (process.env['NODE_PATH']) {
paths = process.env['NODE_PATH'].split(':').concat(paths);
var splitter = process.platform === 'win32' ? ';' : ':';
paths = process.env['NODE_PATH'].split(splitter).concat(paths);
}
modulePaths = paths;