nvm icon indicating copy to clipboard operation
nvm copied to clipboard

unable to install nvm

Open Johnfarcy opened this issue 1 year ago • 16 comments
trafficstars

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

Johnfarcy avatar Aug 09 '24 01:08 Johnfarcy

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

ljharb avatar Aug 09 '24 01:08 ljharb

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

Johnfarcy avatar Aug 09 '24 01:08 Johnfarcy

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?

ljharb avatar Aug 09 '24 01:08 ljharb

/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

Johnfarcy avatar Aug 09 '24 02:08 Johnfarcy

is there anything else in those two files?

ljharb avatar Aug 09 '24 02:08 ljharb

no

Johnfarcy avatar Aug 09 '24 02:08 Johnfarcy

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

ljharb avatar Aug 09 '24 02:08 ljharb

5.9

Johnfarcy avatar Aug 09 '24 02:08 Johnfarcy

… just that? my command includes three pipe characters

ljharb avatar Aug 09 '24 02:08 ljharb

this is the output ||5.9|

Johnfarcy avatar Aug 09 '24 03:08 Johnfarcy

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

ljharb avatar Aug 09 '24 04:08 ljharb

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

Johnfarcy avatar Aug 09 '24 06:08 Johnfarcy

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 avatar Aug 09 '24 07:08 ljharb

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

ljharb avatar Aug 27 '24 20:08 ljharb

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!

roni-estein avatar Sep 07 '24 05:09 roni-estein

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!

ljharb avatar Sep 07 '24 05:09 ljharb