nvm: [Suspected regression] Unable to binary install on zsh

Operating system and version:

nvm debug output:

nvm --version: v0.39.3
$TERM_PROGRAM: tmux
$SHELL: /usr/bin/zsh
$SHLVL: 1
whoami: 'signed'
${HOME}: /home/signed
${NVM_DIR}: '${HOME}/.config/nvm'
${PATH}: ${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.zi/plugins/zdharma---revolver:${HOME}/.zi/polaris/sbin:${HOME}/.zi/polaris/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:/usr/bin:/bin:${HOME}/.dotnet/tools
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (x86_64-suse-linux-gnu)'
uname -a: 'Linux 6.1.4-1-default #1 SMP PREEMPT_DYNAMIC Mon Jan 9 11:00:31 UTC 2023 (4b9b43c) x86_64 x86_64 x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Welcome to openSUSE Tumbleweed 20230112 - Kernel  ().
awk: /usr/bin/awk, GNU Awk 5.2.1, API 3.2, PMA Avon 8-g1, (GNU MPFR 4.1.1-p1, GNU MP 6.2.1)
curl: /usr/bin/curl, curl 7.87.0 (x86_64-suse-linux-gnu) libcurl/7.87.0 OpenSSL/1.1.1s-fips zlib/1.2.12 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh/0.10.4/openssl/zlib nghttp2/1.51.0
wget: /usr/bin/wget, GNU Wget 1.21.3 built on linux-gnu.
git: /usr/bin/git, git version 2.39.0
ls: cannot access 'grep:': No such file or directory
grep: grep: aliased to grep --color (grep --color), grep (GNU grep) 3.8
sed: /usr/bin/sed, sed (GNU sed) 4.9
cut: /usr/bin/cut, cut (GNU coreutils) 9.1
basename: /usr/bin/basename, basename (GNU coreutils) 9.1
ls: cannot access 'rm:': No such file or directory
rm: rm: aliased to rm -i (rm -i), rm (GNU coreutils) 9.1
ls: cannot access 'mkdir:': No such file or directory
mkdir: mkdir: aliased to mkdir -pv (mkdir -pv), mkdir (GNU coreutils) 9.1
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.9.0
nvm current: none
which node: node not found
which iojs: iojs not found
which npm: npm not found
npm config get prefix: nvm:271: command not found: npm
npm root -g: nvm:271: command not found: npm
nvm --version: v0.39.2
$TERM_PROGRAM: tmux
$SHELL: /usr/bin/zsh
$SHLVL: 1
whoami: 'signed'
${HOME}: /home/signed
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.zi/plugins/zdharma---revolver:${HOME}/.zi/polaris/sbin:${HOME}/.zi/polaris/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:/usr/bin:/bin:${HOME}/.dotnet/tools
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (x86_64-suse-linux-gnu)'
uname -a: 'Linux 6.1.4-1-default #1 SMP PREEMPT_DYNAMIC Mon Jan 9 11:00:31 UTC 2023 (4b9b43c) x86_64 x86_64 x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Welcome to openSUSE Tumbleweed 20230112 - Kernel  ().
grep: warning: stray \ before /
curl: /usr/bin/curl, curl 7.87.0 (x86_64-suse-linux-gnu) libcurl/7.87.0 OpenSSL/1.1.1s-fips zlib/1.2.12 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh/0.10.4/openssl/zlib nghttp2/1.51.0
grep: warning: stray \ before /
wget: /usr/bin/wget, GNU Wget 1.21.3 built on linux-gnu.
grep: warning: stray \ before /
grep: warning: stray \ before /
git: /usr/bin/git, git version 2.39.0
ls: cannot access 'grep:': No such file or directory
grep: grep: aliased to grep --color (grep --color), grep (GNU grep) 3.8
grep: warning: stray \ before /
grep: warning: stray \ before /
awk: /usr/bin/awk, GNU Awk 5.2.1, API 3.2, PMA Avon 8-g1, (GNU MPFR 4.1.1-p1, GNU MP 6.2.1)
grep: warning: stray \ before /
grep: warning: stray \ before /
sed: /usr/bin/sed, sed (GNU sed) 4.9
grep: warning: stray \ before /
grep: warning: stray \ before /
cut: /usr/bin/cut, cut (GNU coreutils) 9.1
grep: warning: stray \ before /
grep: warning: stray \ before /
basename: /usr/bin/basename, basename (GNU coreutils) 9.1
ls: cannot access 'rm:': No such file or directory
rm: rm: aliased to rm -i (rm -i), rm (GNU coreutils) 9.1
ls: cannot access 'mkdir:': No such file or directory
mkdir: mkdir: aliased to mkdir -pv (mkdir -pv), mkdir (GNU coreutils) 9.1
grep: warning: stray \ before /
grep: warning: stray \ before /
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.9.0
nvm current: none
which node: node not found
which iojs: iojs not found
which npm: npm not found
npm config get prefix: nvm:298: command not found: npm
npm root -g: nvm:298: command not found: npm

Last working version :

nvm --version: v0.39.1
$TERM_PROGRAM: tmux
$SHELL: /usr/bin/zsh
$SHLVL: 1
whoami: 'signed'
${HOME}: /home/signed
${NVM_DIR}: '${HOME}/.config/nvm'
${PATH}: ${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:${HOME}/.zi/plugins/zdharma---revolver:${HOME}/.zi/polaris/sbin:${HOME}/.zi/polaris/bin:${HOME}/.emacs.d/bin:${HOME}/.cargo/bin:${HOME}/.spicetify:${HOME}/.local/bin:${HOME}/.local/bin/misc/:${HOME}/bin:/usr/local/bin:/usr/bin:/bin:${HOME}/.dotnet/tools
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (x86_64-suse-linux-gnu)'
uname -a: 'Linux 6.1.4-1-default #1 SMP PREEMPT_DYNAMIC Mon Jan 9 11:00:31 UTC 2023 (4b9b43c) x86_64 x86_64 x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Welcome to openSUSE Tumbleweed 20230112 - Kernel  ().
grep: warning: stray \ before /
curl: /usr/bin/curl, curl 7.87.0 (x86_64-suse-linux-gnu) libcurl/7.87.0 OpenSSL/1.1.1s-fips zlib/1.2.12 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh/0.10.4/openssl/zlib nghttp2/1.51.0
grep: warning: stray \ before /
wget: /usr/bin/wget, GNU Wget 1.21.3 built on linux-gnu.
grep: warning: stray \ before /
grep: warning: stray \ before /
git: /usr/bin/git, git version 2.39.0
ls: cannot access 'grep:': No such file or directory
grep: grep: aliased to grep --color (grep --color), grep (GNU grep) 3.8
grep: warning: stray \ before /
grep: warning: stray \ before /
awk: /usr/bin/awk, GNU Awk 5.2.1, API 3.2, PMA Avon 8-g1, (GNU MPFR 4.1.1-p1, GNU MP 6.2.1)
grep: warning: stray \ before /
grep: warning: stray \ before /
sed: /usr/bin/sed, sed (GNU sed) 4.9
grep: warning: stray \ before /
grep: warning: stray \ before /
cut: /usr/bin/cut, cut (GNU coreutils) 9.1
grep: warning: stray \ before /
grep: warning: stray \ before /
basename: /usr/bin/basename, basename (GNU coreutils) 9.1
ls: cannot access 'rm:': No such file or directory
rm: rm: aliased to rm -i (rm -i), rm (GNU coreutils) 9.1
ls: cannot access 'mkdir:': No such file or directory
mkdir: mkdir: aliased to mkdir -pv (mkdir -pv), mkdir (GNU coreutils) 9.1
grep: warning: stray \ before /
grep: warning: stray \ before /
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.9.0
nvm current: none
which node: node not found
which iojs: iojs not found
which npm: npm not found
npm config get prefix: nvm:289: command not found: npm
npm root -g: nvm:289: command not found: npm

nvm ls output:

0.39.3 :

iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)
lts/* -> lts/hydrogen (-> N/A)
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.2 (-> N/A)
lts/gallium -> v16.19.0 (-> N/A)
lts/hydrogen -> v18.13.0 (-> N/A)

How did you install nvm?

First by zsh-nvm then manually by git

What steps did you perform?

  • Install nvm >= v0.39.2 (works on nvm == v0.39.1)
  • Install any version (was trying to install --lts)

What happened?

nvm somehow dumps all of zsh config in the archive download URL, which of course is invalid and even trigger File name too long, source install seems to work

Full log

What did you expect to happen?

Working install

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

Yes

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

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying [2606:4700:10::6814:172e]:443...
* Connected to nodejs.org (2606:4700:10::6814:172e) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
} [5 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [4836 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [520 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=*.nodejs.org
*  start date: Jan 11 00:00:00 2022 GMT
*  expire date: Feb 11 23:59:59 2023 GMT
*  subjectAltName: host "nodejs.org" matched cert's "nodejs.org"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* h2h3 [:method: HEAD]
* h2h3 [:path: /dist/]
* h2h3 [:scheme: https]
* h2h3 [:authority: nodejs.org]
* h2h3 [user-agent: curl/7.87.0]
* h2h3 [accept: */*]
* h2h3 [accept-encoding: deflate, gzip, br, zstd]
* Using Stream ID: 1 (easy handle 0x564b23657890)
} [5 bytes data]
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> user-agent: curl/7.87.0
> accept: */*
> accept-encoding: deflate, gzip, br, zstd
> 
{ [5 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [230 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
} [5 bytes data]
< HTTP/2 200 
< date: Sun, 15 Jan 2023 09:16:00 GMT
< content-type: text/html
< last-modified: Sun, 15 Jan 2023 08:05:05 GMT
< cache-control: max-age=14400
< cf-cache-status: HIT
< age: 4220
< vary: Accept-Encoding
< strict-transport-security: max-age=31536000; includeSubDomains; preload
< x-content-type-options: nosniff
< server: cloudflare
< cf-ray: 789d8299b95ad636-CDG
< content-encoding: br
< 

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host nodejs.org left intact
HTTP/2 200 
date: Sun, 15 Jan 2023 09:16:00 GMT
content-type: text/html
last-modified: Sun, 15 Jan 2023 08:05:05 GMT
cache-control: max-age=14400
cf-cache-status: HIT
age: 4220
vary: Accept-Encoding
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
server: cloudflare
cf-ray: 789d8299b95ad636-CDG
content-encoding: br

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (13 by maintainers)

Most upvoted comments

@ljharb

Result of my bisection :

fb4538b360a4ddd5d390442f3bfde9b3239b4413 is the first faulty commit, and indeed L variable has been introduced

Doing local L in my shell indeed prints the whole shell config

@ljharb After reading the code, I fail to understand the exact usage for that variable

Why are you needing to parse ls? To get the destination of a symlink, parsing ls is never a good idea, and readlink is the standard utility for it.

od resolves symlinks itself (and did since forever), eliminating the manual step of resolving a symlink

https://github.com/coreutils/coreutils/blob/d5868df0d0a6bd09387ece41b62b873fd7c201f9/src/od.c#L925

Even after unsetting L as an alias, it still fails

I tried in zsh --no-rc, and it works, but I still don’t know why it doesn’t happen with v0.39.1 in my regular environment

I am closing for now as not planned and when I’ll have time, I’ll bisect it, try to find the issue and post it here

No change in the behaviour