-
Notifications
You must be signed in to change notification settings - Fork 642
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_VERSION_PREFIX default value should be empty string? #207
Comments
Actually if I remove the 'v' prefix from my .nvmrc and export NODE_VERSION_PREFIX='v' it works okay. Of course it'd be nice if an .nvmrc file is located that the NVM_DIR is used or |
I've just updated the wiki page so it reflects all of this: https://github.com/direnv/direnv/wiki/Node If you set both |
Thanks. If you have any ideas on how to improve the stdlib.sh just let me know. I don't have a setup with nvm installed right now to test. |
Currently For example: http://nodejs.org/dist/latest/node-v5.9.0-darwin-x64.tar.gz I typically pull them down like so:
I started doing It might be best to make the default either Whatever feels like the most unsurprising default is what it should be. The line in question is: Line 477 in ff51d5f
|
One way to improve it would using nvm itself to resolve node. That would reduce the need for redundant environment vars too. e.g., say I have the following versions of node installed:
nvm can resolve the exact location for you like this:
i.e., if you find an .nvmrc file, and nvm is on the PATH, then use nvm to resolve node rather than
|
Is load_prefix useful other than setting the PATH ? Otherwise this could almost be reduced to: use_node() {
PATH_add "$(nvm which $(< .nvmrc))"
} |
So, I should have realized why you are even doing this when you are already using If that is the case, maybe you can add the following to your
|
Also, if you are wondering why one wouldn't just use |
@wilmoore please do, it's always interesting to hear people's opinion. For nvm you might want to put a shim like this in your nvm() {
. ~/.nvm/nvm.sh
nvm "$@"
} |
I kinda wanted to avoid openly disparaging someone's work, especially given it's a free too and the author works on it in his free time; however, you've asked so I will answer. The short and sweet answer is that I feel it is unnecessarily opinionated and has subtle but unexpected (annoying) behavior. For example, it will actually refuse to work if you have certain legitimate For me, the cons outweigh the pros. I've spoken to other developers about it and some feel the pros are worth it. For me, the pros I have replicated by using I outlined earlier how to install node versions via I also have tried using Here are some links which will point you to some of my gripes:
|
Interesting. That's generally the same conclusion I had in regards to ruby version managers (and lead to this tool). For ruby I use ruby-install that puts different version of ruby inside of Adding your nodejs-install method to the wiki would be helpful to others I believe. |
Indeed. I've bounced around a few different ruby version managers as well. I even wrote one and threw it out eventually :)
Yup, same here.
I was thinking about it. I was hoping to clean up the docs a bit to make installing easier and potentially setup an actual brew tap so you don't have to install via a URL. That being said, I'll go ahead and add it and hopefully I'll do that cleanup soon. |
Cool. In my experience, something is better than a perfect nothing :) At some point I would love to create a guide book and having pointers from the wiki will be very helpful. |
👍 |
Alright. Closing since we discussed all the options and there is no clear actionable for now (except improve the wiki). But feel free to pile it on if you feel that there is more to say about it. I'm also often on IRC on the freenode #direnv channel if you want to discuss about anything. Or just open another issue with the topic you have in mind if you prefer async discussions. |
I'm using NVM to manage node versions. So node versions are stored in ~/.nvm/versions/node.
In my .envrc I have
And in my ~/.bashrc I've exported NODE_VERSIONS
use_node fails the find query because it's defaulting to adding a prefix of 'node-v' instead of the empty string.
As a workaround I've added the following function to ~/.direnvrc but I'm wondering if there was something I missed? Otherwise, can the default value be empty for NODE_VERSION_PREFIX?
The text was updated successfully, but these errors were encountered: