Skip to content
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

Default NVM_DIR variable not portable between OSes #1346

Closed
lexrj opened this issue Dec 8, 2016 · 4 comments
Closed

Default NVM_DIR variable not portable between OSes #1346

lexrj opened this issue Dec 8, 2016 · 4 comments
Labels
feature requests I want a new feature in nvm! installing nvm Problems installing nvm itself pull request wanted This is a great way to contribute! Help us out :-D

Comments

@lexrj
Copy link

lexrj commented Dec 8, 2016

Because it is adding variables to .bashrc, it should be safe to assume the $HOME variable is set. Would it be possible to have the line that is appended to .bashrc be export NVM_DIR="$HOME/.nvm" to afford portability of profiles between systems?

Noticed this when copying my .bashrc from linux to OS X and having the install script fail because it couldn't install the the NVM_DIR specified by my linux .bashrc.

@ljharb
Copy link
Member

ljharb commented Dec 8, 2016

That does seem like a reasonable change.

@ljharb ljharb added installing nvm Problems installing nvm itself pull request wanted This is a great way to contribute! Help us out :-D labels Dec 23, 2016
@DesignByOnyx
Copy link
Contributor

DesignByOnyx commented Jan 11, 2017

I am experiencing this same issue. I share my bash profile across several machines. Updating to use NVM_DIR="$HOME/.nvm" allowed me to keep working. Also worth noting that rvm uses $HOME in their scripts.

@ljharb
Copy link
Member

ljharb commented Jan 11, 2017

@DesignByOnyx note that you're welcome to do this manually after installing nvm, it's only on the first install that this request would change anything.

@ljharb ljharb added the feature requests I want a new feature in nvm! label Jan 11, 2017
@DesignByOnyx
Copy link
Contributor

Yeah, I saw that in the shell script -> you don't touch the profile if NVM_DIR already exists. For my situation, I installed nvm on Machine A weeks ago, moved to Machine B, installed nvm, and got a warning that the directory /Users/machine-a-user/ does not exist. The one time change was easy, but I wanted to support the use of $HOME instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature requests I want a new feature in nvm! installing nvm Problems installing nvm itself pull request wanted This is a great way to contribute! Help us out :-D
Projects
None yet
Development

No branches or pull requests

3 participants