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

nvm install Argon etc works, and should not #3474

Open
IdWV opened this issue Nov 19, 2024 · 9 comments
Open

nvm install Argon etc works, and should not #3474

IdWV opened this issue Nov 19, 2024 · 9 comments
Labels
bugs Oh no, something's broken :-( installing nvm Problems installing nvm itself pull request wanted This is a great way to contribute! Help us out :-D

Comments

@IdWV
Copy link

IdWV commented Nov 19, 2024

Operating system and version:

Ubuntu server 24.04.1, x86-64, clean install, removed snapd and unattended-updates

nvm debug output:

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

nvm ls output:

       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

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:

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 ']'
@ljharb
Copy link
Member

ljharb commented Nov 19, 2024

Your default version is set to “Jod”, which isn’t a thing - perhaps you want nvm alias default lts/jod?

@IdWV
Copy link
Author

IdWV commented Nov 19, 2024

Thanks! That solved the issue. So the problem is elsewhere. Now I remember that I didn´t nvm install 22, but nvm install Jod (copy&pasted from nvm ls-remote). If Jod isn't a thing, I suppose nvm should refuse to install it.

@ljharb
Copy link
Member

ljharb commented Nov 19, 2024

I agree - it shouldn’t have been able to install it at all. If you, eg, run nvm install Argon, what happens? If that succeeds then this may be a bug.

@IdWV
Copy link
Author

IdWV commented Nov 19, 2024

~$ nvm install Argon
Downloading and installing node v4.9.1...
Downloading https://nodejs.org/dist/v4.9.1/node-v4.9.1-linux-x64.tar.xz...
################################################################################################################################################################# 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v4.9.1 (npm v2.15.11)

but:

~$ nvm uninstall Argon
N/A version is not installed...

@ljharb
Copy link
Member

ljharb commented Nov 19, 2024

and nvm uninstall argon presumably fails the same?

@ljharb
Copy link
Member

ljharb commented Nov 19, 2024

if so, then the bug is that it allows you to install based on the LTS name alone in the first place :-) and let's update this issue to reflect that.

@IdWV
Copy link
Author

IdWV commented Nov 19, 2024

and nvm uninstall argon presumably fails the same?

Indeed.

if so, then the bug is that it allows you to install based on the LTS name alone in the first place :-) and let's update this issue to reflect that.

What do you mean with 'update this issue'?

@ljharb ljharb changed the title nvm script in .bashrc doesn't work on clean Ubuntu server 24.04.1 nvm install Argon etc works, and should not Nov 19, 2024
@ljharb ljharb added bugs Oh no, something's broken :-( pull request wanted This is a great way to contribute! Help us out :-D installing nvm Problems installing nvm itself labels Nov 19, 2024
@IdWV
Copy link
Author

IdWV commented Nov 19, 2024

Ah, I see.

@Mariozisa1

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Oh no, something's broken :-( 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