-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Install from zsh doesn't install to bash. Install from bash doesn't install to bash #1717
Comments
Ok, this bash/zsh configuration is a mess. There's three places I want nvm:
See more about interactive/non-interactive here nvm installs for zsh interactive using .zshrc when zsh is installed WORKAROUND: copy this code into your .bashrc (or other bash config file see link above)
TEST: |
Profile detection is very tricky. It's always great to get improvements here. |
@ljharb Hey Jordan, I could make a PR for this, but it would be a pretty big refactor of install.sh. My approach would be to refactor nvm_do_install() starting at about install.sh:328 to:
I think that would mean we can get rid of
|
I'm not sure it makes sense to prioritize zsh over bash in that way; bash is my default shell, but I do have a |
Hey Jordan, neither would be prioritized over the other. It would add to both .zshrc and .bashrc if available. Is there a reason it should only be in one shell or the other? |
I'm using
into My suggestion is to add those lines in Another nice trick I found from http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html Edit your
|
I had a pr recently that may have solved this issue for you. However the script detects if your using bash or zsh first. in the event the shell type is unknown it'll check in this order If installing with zsh, you can do |
Why not add the lines to all present known profile files? I am guessing that it would be better to have duplicates rather than missing configuration if it is tricky to get the default shell type |
That seems like it would resolve this issue, but it would be brittle and perhaps overly intrusive. |
True, but I think inexperienced linux users may be discouraged from using nvm and eventually nodejs as there are occasional permission issues that needs to be fixed manually when used without nvm. This may be a bit too much of a nitpicking, the solution is one googling away for zsh users anyways, but eventually one of two compromises has to be chosen, and one saves time, so :) |
Operating system and version:
Linux mcdesktop 4.13.0-32-generic nvm.sh fails to source on initial install #35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
nvm debug
output:works in zsh, not in bash
How did you install
nvm
? (e.g. install script in readme, homebrew):in zsh, using
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
What steps did you perform?
What happened?
nvm to be installed.
nvm to install to bash when run from bash
nvm to install in zsh AND bash.
(I use zsh, but write scripts with
#/bin/bash
for compatibility with people not using zsh).bashrc
,.bash_profile
,.zshrc
, etc) that modifies thePATH
?The text was updated successfully, but these errors were encountered: