nvm: nvm ls hangs at time or gets into a weird state

On Linux:

When I do nvm ls, it will hang or never return to a terminal prompt and will keep printing “$” but not allow command to be entered.

In video I am unble to type anything once the terminal prompt “$”, what you see is my hitting “enter” key multiple times to get out of this state. Press CTRL+C doesn’t help.

Video: https://youtu.be/FxAQcqmjya4

Operating system and version:

Operating System: openSUSE Tumbleweed 20240121

nvm debug output:

$ nvm debug
nvm --version: v0.39.7
$SHELL: /bin/bash
$SHLVL: 1
whoami: 'yadav'
${HOME}: /home/yadav
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${HOME}/.sdkman/candidates/java/current/bin:${NVM_DIR}/versions/node/v18.19.0/bin:${HOME}/.cabal/bin:${HOME}/.ghcup/bin:${HOME}/.yarn/bin:/opt/local/apps/tfenv/bin/:${HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin:/snap/bin:${HOME}/.sdkman/candidates/maven/current/bin:${HOME}/.sdkman/candidates/gradle/current/bin:/opt/local/apps/go/bin:/home/TT1TB/dev2/Android/cmdline-tools/latest/bin:/home/TT1TB/dev2/Android/platform-tools:/home/TT1TB/dev2/Android/emulator:${HOME}/Android/Sdk/build-tools/34.0.0:${HOME}/.local/bin:/opt/local/apps/youtube-dl/:/opt/local/apps/:/opt/local/apps/idea-IC-223.8214.52/bin/
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 5.2.26(1)-release (x86_64-suse-linux)'
uname -a: 'Linux 6.6.11-1-default #1 SMP PREEMPT_DYNAMIC Thu Jan 11 08:01:39 UTC 2024 (05ae4ad) x86_64 x86_64 x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Welcome to openSUSE Tumbleweed 20240121 - Kernel  ().
awk: /usr/bin/awk, GNU Awk 5.3.0, API 4.0, PMA Avon 8-g1, (GNU MPFR 4.2.1, GNU MP 6.3.0)
curl: /usr/bin/curl, curl 8.5.0 (x86_64-suse-linux-gnu) libcurl/8.5.0 OpenSSL/3.1.4 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh/0.10.5/openssl/zlib nghttp2/1.58.0 OpenLDAP/2.6.6
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 -i), 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: v18.19.0
which node: ${NVM_DIR}/versions/node/v18.19.0/bin/node
which iojs: which: no iojs in (${HOME}/.sdkman/candidates/java/current/bin:${NVM_DIR}/versions/node/v18.19.0/bin:${HOME}/.cabal/bin:${HOME}/.ghcup/bin:${HOME}/.yarn/bin:/opt/local/apps/tfenv/bin/:${HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin:/snap/bin:${HOME}/.sdkman/candidates/maven/current/bin:${HOME}/.sdkman/candidates/gradle/current/bin:/opt/local/apps/go/bin:/home/TT1TB/dev2/Android/cmdline-tools/latest/bin:/home/TT1TB/dev2/Android/platform-tools:/home/TT1TB/dev2/Android/emulator:${HOME}/Android/Sdk/build-tools/34.0.0:${HOME}/.local/bin:/opt/local/apps/youtube-dl/:/opt/local/apps/:/opt/local/apps/idea-IC-223.8214.52/bin/)
which npm: ${NVM_DIR}/versions/node/v18.19.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v18.19.0
npm root -g: ${NVM_DIR}/versions/node/v18.19.0/lib/node_modules

nvm ls output:

$ $ $ $ $ $

How did you install nvm?

readme install script

What steps did you perform?

typed nvm ls

What happened?

hangs as time, other times only prints “$” (prompt) but I cannot type. Pressing CTRL+C doesn’t help.

What did you expect to happen?

execute the command correctly.

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

YES, but in the past nvm worked fined and nothing was changed in defined path.

If you are having installation issues, or getting “N/A”, what does curl -I --compressed -v https://nodejs.org/dist/ print out?


About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

No - v0.39.7 is the same version you reported the problem in, so that suggests it was something else on your machine. Closing for now, but happy to reopen if needed.

Hi I tried “TERM=dumb nvm ls” several times and it doesn’t hang.

No hanging with nvm_ls.

$ nvm_ls
v18.19.0
v20.10.0
v20.11.0

This has been a problem for a long while, I finally got annoyed to file a report.