-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: recommend against use of node_path #1708
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -429,6 +429,18 @@ of absolute paths, then io.js will search those paths for modules if they | |
are not found elsewhere. (Note: On Windows, `NODE_PATH` is delimited by | ||
semicolons instead of colons.) | ||
|
||
`NODE_PATH` was originally created to support loading modules from | ||
varying paths before the current | ||
[module resolution](https://iojs.org/api/modules.html) algorithm was | ||
frozen. | ||
|
||
`NODE_PATH` is still supported, but is less necessary now that the io.js | ||
ecosystem has settled on a convention for locating dependent modules. | ||
Sometimes deployments that rely on `NODE_PATH` show surprising behavior | ||
when people are unaware that `NODE_PATH` must be set. Sometimes a | ||
module's dependencies change, causing a different version (or even a | ||
different module) to be loaded as the `NODE_PATH` is searched. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We go on in the document to suggest using NODE_PATH to make global modules require-able in the REPL – we should probably nix that. I'd also suggest bolding the line below, "You are highly encouraged to place your dependencies locally in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd move this disclaimer about global modules to the top of this section, possibly bolding it. |
||
|
||
Additionally, io.js will search in the following locations: | ||
|
||
* 1: `$HOME/.node_modules` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This links back to the document itself – perhaps this is missing an anchor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could possible link to https://iojs.org/api/modules.html#modules_all_together, although I don't really like this header name :)