Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Close #1349 Delimit NODE_PATH with ; on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 17, 2011
1 parent 93899cb commit 448eab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion doc/api/modules.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 2 additions & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 448eab2

Please sign in to comment.