Repository: nvm
Issue: `nvm install Argon` etc works, and should not
Labels: bugs,pull request wanted,installing nvm

#### Operating system and version:
Ubuntu server 24.04.1, x86-64, clean install, removed snapd and unattended-updates

#### `nvm debug` output:
<details>

```sh
nvm debug
nvm --version: v0.40.1
$SHELL: /bin/bash
$SHLVL: 1
whoami: 'user'
${HOME}: /home/user
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)'
uname -a: 'Linux 6.8.0-48-generic #48-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 14:04:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Ubuntu 24.04.1 LTS  
awk: /usr/bin/awk, GNU Awk 5.2.1, API 3.2, PMA Avon 8-g1, (GNU MPFR 4.2.1, GNU MP 6.3.0)
curl: /usr/bin/curl, curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 (+libidn2/2.3.7) libssh/0.10.6/openssl/zlib nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.7
wget: /usr/bin/wget, GNU Wget 1.21.4 built on linux-gnu.
git: /usr/bin/git, git version 2.43.0
grep: /usr/bin/grep (grep --color=auto), grep (GNU grep) 3.11
sed: /usr/bin/sed, sed (GNU sed) 4.9
cut: /usr/bin/cut, cut (GNU coreutils) 9.4
basename: /usr/bin/basename, basename (GNU coreutils) 9.4
rm: /usr/bin/rm, rm (GNU coreutils) 9.4
mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 9.4
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.9.0
nvm current: none
which node: 
which iojs: 
which npm: 
npm config get prefix: Command 'npm' not found, but can be installed with:
sudo apt install npm
npm root -g: Command 'npm' not found, but can be installed with:
sudo apt install npm
```
</details>

#### `nvm ls` output:
<details>

```sh
       v22.11.0
default -> Jod (-> N/A)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v22.11.0) (default)
stable -> 22.11 (-> v22.11.0) (default)
lts/* -> lts/jod (-> v22.11.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.5 (-> N/A)
lts/iron -> v20.18.0 (-> N/A)
lts/jod -> v22.11.0
```
</details>

#### How did you install `nvm`?
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

#### What steps did you perform?
install nvm, execute
nvm install 22
logout, login (over ssh, headless box)

#### What happened?
It downloaded node, but it doesn't seem to 'know' it. The node directory in ~/.nvm isn't added to PATH.

#### What did you expect to happen?
Being able to run node. 

#### Is there anything in any of your profile files that modifies the `PATH`?
No. Virgin system.

Additional info:
I have tried older versions of the nvm script. Didn't help.

I can run node, when I execute 'nvm use 22'. Then the PATH is changed, until next logout/login.

As a test I added 'set -x' in .bashrc before the 3 added lines. The output on login:
<details>

```sh
iiiin++ export NVM_DIR=/home/user/.nvm
++ NVM_DIR=/home/user/.nvm
++ '[' -s /home/user/.nvm/nvm.sh ']'
++ . /home/user/.nvm/nvm.sh
+++ NVM_SCRIPT_SOURCE=']'
+++ '[' -z '' ']'
+++ export NVM_CD_FLAGS=
+++ NVM_CD_FLAGS=
+++ nvm_is_zsh
+++ '[' -n '' ']'
+++ '[' -z /home/user/.nvm ']'
+++ case $NVM_DIR in
+++ unset NVM_SCRIPT_SOURCE
+++ nvm_process_parameters
+++ local NVM_AUTO_MODE
+++ NVM_AUTO_MODE=use
+++ '[' 0 -ne 0 ']'
+++ nvm_auto use
+++ local NVM_MODE
+++ NVM_MODE=use
+++ case "${NVM_MODE}" in
+++ local VERSION
+++ local NVM_CURRENT
++++ nvm_ls_current
++++ local NVM_LS_CURRENT_NODE_PATH
+++++ command which node
++++ NVM_LS_CURRENT_NODE_PATH=
++++ nvm_echo none
++++ command printf '%s\n' none
+++ NVM_CURRENT=none
+++ '[' _none = _none ']'
++++ nvm_resolve_local_alias default
++++ nvm_echo
++++ command printf '%s\n' ''
+++ VERSION=N/A
+++ '[' -n N/A ']'
+++ '[' _N/A '!=' _N/A ']'
+++ return 0
++ '[' -s /home/user/.nvm/bash_completion ']'
++ . /home/user/.nvm/bash_completion
+++ command -v nvm
+++ [[ -n '' ]]
+++ complete -o default -F __nvm nvm
+ '[' -d /home/user/bin ']'
+ '[' -d /home/user/.local/bin ']'
```
</details>