-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Fix for Issue #39 regarding NODE_PATH
#47
Conversation
* 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 |
@@ -1,7 +1,7 @@ | |||
{ | |||
"name" : "resolve", | |||
"description" : "resolve like require.resolve() on behalf of files asynchronously and synchronously", | |||
"version" : "0.7.1", | |||
"version" : "0.7.2", |
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.
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.js
to ensure$NODE_PATH
environmentvariable is respected when searching for a module.
node-modules-paths
module to include the directoriesspecified by
process.env.NODE_PATH
.