diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown index 1ceb87edfca3..c1e3a2065590 100644 --- a/doc/api/modules.markdown +++ b/doc/api/modules.markdown @@ -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: diff --git a/lib/module.js b/lib/module.js index 5e3fd84d09d2..1c3d4d3acfaa 100644 --- a/lib/module.js +++ b/lib/module.js @@ -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;