Fix for Issue #39 regarding NODE_PATH#47
Fix for Issue #39 regarding NODE_PATH#47job13er wants to merge 3 commits intobrowserify:masterfrom job13er:node-path
NODE_PATH#47Conversation
* Added tests to `test/node_path.js` to ensure `$NODE_PATH` environment variable is respected when searching for a module. * Updated the `node-modules-paths` module to include the directories specified by `process.env.NODE_PATH`.
|
Fixes #39 |
package.json
Outdated
There was a problem hiding this comment.
Let me know if you'd rather not include this in the PR. I'm not sure how you handle your releases.
|
Anyone know how to simulate the environment in the travis build system? I can't reproduce the build failure. I installed |
|
Nevermind, I figured it out, they have |
|
This is what |
|
So if people are using NODE_PATH, and a project they want to install uses resolve.sync() instead of require(), they'll get an error? Is that intended behavior? Isn't this what NODE_PATH is for? |
Yes. We ran into that, which is why I tried to submit this fix. We weren't using
Apparently, since my PR was dismissed. I guess it's intended or anyone who wants to use
We ended up going with option 3, since it appeared support for
We thought so. However, the latest docs do suggest not using |
browserify doesn't implicitly set opts.paths to NODE_PATH anymore unlike stated previously in this documentation. For background see: * browserify/resolve#39 (comment) * browserify/resolve#47 * browserify/browserify#1626
browserify doesn't implicitly set opts.paths to NODE_PATH anymore unlike stated previously in this documentation. For background see: * browserify/resolve#39 (comment) * browserify/resolve#47 * browserify/browserify#1626
test/node_path.jsto ensure$NODE_PATHenvironmentvariable is respected when searching for a module.
node-modules-pathsmodule to include the directoriesspecified by
process.env.NODE_PATH.