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

unable to install nvm #3406

Open
Johnfarcy opened this issue Aug 9, 2024 · 16 comments
Open

unable to install nvm #3406

Johnfarcy opened this issue Aug 9, 2024 · 16 comments
Labels
installing nvm Problems installing nvm itself needs followup We need some info or action from whoever filed this issue/PR. OS: Mac OS pull request wanted This is a great way to contribute! Help us out :-D

Comments

@Johnfarcy
Copy link

Operating system and version:

nvm debug output:

command not. found

nvm ls output:

command not found

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

output --
Error: the install instructions explicitly say to pipe the install script to bash; please follow them

What steps did you perform?

What happened?

bash has been depreciated on Mac

What did you expect to happen?

Is there anything in any of your profile files that modifies the PATH?

the usual instructions as mentioned

@ljharb
Copy link
Member

ljharb commented Aug 9, 2024

bash has not been deprecated on Macs, it's just no longer the default shell. What Mac OS version are you using?

@Johnfarcy
Copy link
Author

my bad. bash does exist but this isn't working. Sonoma

@ljharb
Copy link
Member

ljharb commented Aug 9, 2024

I have Sonoma and it works fine. Are you sure you're not doing anything in bashrc or bash_profile that might make the install script not realize it's bash? What does which bash say?

@Johnfarcy
Copy link
Author

Johnfarcy commented Aug 9, 2024

/bin/bash
bashrc and bash_profile - I added- this.

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion
''
default shell is zsh

@ljharb
Copy link
Member

ljharb commented Aug 9, 2024

is there anything else in those two files?

@Johnfarcy
Copy link
Author

Johnfarcy commented Aug 9, 2024

no

@ljharb
Copy link
Member

ljharb commented Aug 9, 2024

what does echo "|$BASH_VERSION|$ZSH_VERSION|" print out?

@Johnfarcy
Copy link
Author

5.9

@ljharb
Copy link
Member

ljharb commented Aug 9, 2024

… just that? my command includes three pipe characters

@Johnfarcy
Copy link
Author

this is the output
||5.9|

@ljharb
Copy link
Member

ljharb commented Aug 9, 2024

ah right, in zsh that's expected - what if you run bash -c 'echo "|$BASH_VERSION|$ZSH_VERSION|"'?

@Johnfarcy
Copy link
Author

ohh , this is the output for that .. |3.2.57(1)-release||

@ljharb
Copy link
Member

ljharb commented Aug 9, 2024

hm, ok, that's the same output i get - but given that output, the install script should be working fine. I'm pretty confused.

@ljharb ljharb added OS: Mac OS needs followup We need some info or action from whoever filed this issue/PR. pull request wanted This is a great way to contribute! Help us out :-D installing nvm Problems installing nvm itself labels Aug 10, 2024
@ljharb
Copy link
Member

ljharb commented Aug 27, 2024

Can you try v0.40.1 ? It's possible that some fixes in there will address this.

@roni-estein
Copy link

bash -c 'echo "|$BASH_VERSION|$ZSH_VERSION|"'

Hey I had the same output, on an apple M1, but this might be of interest for you. I had an alias for a command not in use on my system

"shift" took me to a directory in my codebase where I was migrating another older different project on a service called shift of course. I noticed that the ls and ls-remote hung but also moved me to that project after [ctrl + c] when I re-aliased that command to something else ls worked again.

I didn't source dive the code, but when I write public consumed packages I often declare and unset my commands locally for just that reason, however, that can have some side effects depending on the system so sometimes scoping them with weird namespace name like nvm:internals:shift might reduce or eliminate collisions.

Anyhow I hope that helps someone!

@ljharb
Copy link
Member

ljharb commented Sep 7, 2024

Certainly you can override shell builtins, but you also never should. If you override shift, then I'd expect lots of thizngs to break in novel ways. Thanks for clearing that up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm Problems installing nvm itself needs followup We need some info or action from whoever filed this issue/PR. OS: Mac OS 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