-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
NODE_PATH deprecation (TC voted negative) #1627
Comments
It wasn't just suggested, it was decided, a few TC meetings ago. |
Ack, I haven't been following that closely on this one. That leaves the question on alternatives open. Do we want users to only use local modules? Any other alternatives? |
I think there are approximately 30 npm modules that duplicate this functionality. I see at least three at https://www.npmjs.com/search?q=require |
And in general yes, you should be using either local modules or putting things in node_modules if you want to require them by name. |
|
Suppose we have a bunch of private modules all stored in one With application/
bin/
start.js
node_modules/
commander/
express/
/* other public modules */
private_modules/
CVS/
companyname-mod/
companyname-stuff/
companyname-web/
/* other private modules with prefix */ ... and an application is started as Now how is one supposed to run a project this way without using Making symlinks from Funny structures like putting everything to
|
I've changed my mind about NODE_PATH. It's been semi-deprecated for ages but we have been stupid enough to leave it in the documentation without so much as a deprecation notice. As a result, it's in active use and people do useful things with it. See for example this recent reddit topic about scripting. Breaking such use cases is not nice. I think NODE_PATH must stay. |
I'm loathe to admit it, but yeah, I think it's going to be around for a long time to come, especially given the google search results for the term. |
I'd rather just remove the " |
Another use case: Docker dev environment.
|
Maybe we should bring this up again at a tc meeting and reconsider our previous sentiments? |
Yeah, please discuss it so we know how to process come 3.0. |
So it was decided to keep this docs-only. The current NODE_PATH section includes
I think the reasons for discouraging NODE_PATH should be laid out. Any suggestions? |
I'd like to see some npm client folk contribute to this discussion; @othiym23, @linclark, @iarna, @smikes, @timoxley, (other?) - summary for you - we want to be clearer about a recommendation against using |
I would suggest structuring the docs something like this --
Possibly related case on |
I like that very much 👍. We should probably still call it |
I'd strike the third paragraph of @smikes's proposed text. Speaking for npm, it's not at all clear how things are going to shake out with @rlidwka Your example is interesting, because as stated, that example doesn't need I do think the proper solution lives somewhere between @rvagg |
for the record I'm not proposing deprecation of |
@rvagg I'm just responding to your RFC upthread, not making any assumptions about your own position on the change. ;) |
I am -1 on removing The point of Node is not to create the most elegant system possible. The point of Node is to make it easy for people to write software. Any changes that can only make it harder while providing no tangible benefits to people writing software are bad changes. Compare this to This is JavaScript, not Haskell. Either purity serves the goal of creating software, or we throw purity overboard. |
@isaacs, @othiym23, etc. please note this issue is now inappropriately named. The TC explicitly disagreed with deprecation and this is now simply a call to adjust documentation to discourage its usage rather than suggest it's an idiomatic way to use Node. If you disagree with even changing documentation then please let us know. |
I guess it may also be worthwhile discussing how this may eventually play out regarding es6 modules. (if we want differences. More of an NG topic though.) |
It's premature to do that, in the absence of a viable loader spec or even a candidate implementation of the static syntax in V8. It's also more or less completely unrelated to this issue. |
@rvagg I'm super ok with updating the docs to discourage use of globals and environment variables, sure. I made a rather forceful case for not deprecating |
New version incorporating feedback:
|
@smikes 👍 |
@smikes That looks great |
@smikes 👍 |
Closing since we aren't deprecating. |
This came up a few times now, and has been suggested again in #1452 (comment)
What is the recommended alternative to
NODE_PATH
should we choose to remove it? There is probably a lot of misuse withNODE_PATH
around, but is it really so bad that we want to drop it completely? How should we handle warnings?The text was updated successfully, but these errors were encountered: