nvm icon indicating copy to clipboard operation
nvm copied to clipboard

nvm ls-remote only displays iojs versions

Open javedbartlett opened this issue 2 years ago • 10 comments

First off, I've checked the following issues and none of them been able to solve my issue:

https://github.com/nvm-sh/nvm/issues/673, https://github.com/nvm-sh/nvm/issues/667, https://github.com/nvm-sh/nvm/issues/638, https://github.com/nvm-sh/nvm/issues/653 and https://github.com/nvm-sh/nvm/issues/669

Operating system and version:

Windows 10, but using WSL2 with zsh, i have run sudo apt update && sudo apt upgrade to ensure everything is update.

curl -V output:

curl -V
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

nvm debug output:

nvm --version: v0.39.2
$TERM_PROGRAM: vscode
$SHELL: /usr/bin/zsh
$SHLVL: 1
whoami: 'javed'
${HOME}: /home/javed
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${HOME}/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/Sennheiser/SenncomSDK/:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/jabartlett/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/jabartlett/AppData/Local/Programs/Microsoft VS Code/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.8 (x86_64-ubuntu-linux-gnu)'
uname -a: 'Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Ubuntu 20.04.5 LTS  
curl: /usr/bin/curl, curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
wget: /usr/bin/wget, GNU Wget 1.20.3 built on linux-gnu.
git: /usr/bin/git, git version 2.25.1
grep: /usr/bin/grep, grep (GNU grep) 3.4
awk: /usr/bin/awk, GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0)
sed: /usr/bin/sed, sed (GNU sed) 4.7
cut: /usr/bin/cut, cut (GNU coreutils) 8.30
basename: /usr/bin/basename, basename (GNU coreutils) 8.30
rm: /usr/bin/rm, rm (GNU coreutils) 8.30
mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 8.30
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.7.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

nvm ls output:

            N/A
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)

How did you install nvm?

install script in readme

What steps did you perform?

Installed via script, put the export command in .zshrc.

I also ran nvm_download -L $NVM_NODEJS_ORG_MIRROR/ --verbose -o - and got the following output:

* Closing connection -1
curl: (3) URL using bad/illegal format or missing URL

What happened?

When i run nvm ls-remote i just get the iojs versions

What did you expect to happen?

I expected to see the nodejs versions populate

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

Nope

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

*   Trying 104.20.23.46:443...
* TCP_NODELAY set
* Connected to nodejs.org (104.20.23.46) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: self signed certificate in certificate chain
* Closing connection 0
curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

I followed the link, but was unable to solve the issue. To add, I'm using a PC located at work in a PC farm. It's behind a work network using a self signed certificate

javedbartlett avatar Oct 15 '22 03:10 javedbartlett

Running echo insecure >> ~/.curlrc fixed the problem. I wish there was a cleaner/safer solution though, so i will keep open for now in case there are any suggestions that can help others in the future :-)

javedbartlett avatar Oct 15 '22 03:10 javedbartlett

nvm ignores curlrc so that shouldn’t fix anything except the debug command in the issue template.

the implication is that your OS’s SSL certificates are invalid somehow. Make sure your system clock is correct as well.

ljharb avatar Oct 15 '22 05:10 ljharb

Same question. version: 0.39.1 image

mxismean avatar Oct 19 '22 09:10 mxismean

Same problem, solved with:

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm ls-remote

So add it to ~/.zshrc(I use zsh):

export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist

tianheg avatar Dec 02 '22 07:12 tianheg

@tianheg that's the default value, so that fix should only work if you're overriding it elsewhere to point somewhere else.

ljharb avatar Dec 02 '22 18:12 ljharb

I'm having the same issue trying to install node on Ubuntu 20.04. I followed the README, but all I see from "nvm ls-remote" is iojs versions. If I try "nvm install node", it says that it can't find a version called "node". I have confirmed that the environment variable NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist is set correctly.

I am running as root. I see several complaints from people with nvm issues running as root, but I have not found anything documented that it isn't supported. Can anyone confirm?

xendren avatar Jan 13 '24 17:01 xendren

@xendren what happens if you run this command from the issue template? curl -I --compressed -v https://nodejs.org/dist/

Separately, technically if you do everything as root, nvm should work fine, but in general you should be doing nothing as root.

ljharb avatar Jan 13 '24 17:01 ljharb

I'm getting the same thing:

This is my Containerfile:

FROM python:3.12.2
ENV POETRY_HOME=/opt/poetry
RUN python3 -m venv $POETRY_HOME
RUN $POETRY_HOME/bin/pip install poetry==1.8.2
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && . ~/.bashrc && nvm ls-remote
RUN npm install -g semantic-release @semantic-release/changelog @semantic-release/git conventional-changelog-conventionalcommits

Build output:

STEP 1/6: FROM python:3.12.2
STEP 2/6: ENV POETRY_HOME=/opt/poetry
--> Using cache 48c9055352c3e39899a6e9c235c196bb0959eea7b5f68ef54d7678e75324a4c9
--> 48c9055352c3
STEP 3/6: RUN python3 -m venv $POETRY_HOME
--> Using cache 083209c776828b8725b2bf0d77b61a7eca2f93931cb2b3ab595d2a12ee5dbbe9
--> 083209c77682
STEP 4/6: RUN $POETRY_HOME/bin/pip install poetry==1.8.2
--> Using cache 3fc9b8937a1f55b597697d81a0ae503edcdef0e0b301dd1c42aae258c87308f4
--> 3fc9b8937a1f
STEP 5/6: RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && . ~/.bashrc && nvm ls-remote
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16555  100 16555    0     0   155k      0 --:--:-- --:--:-- --:--:--  156k
=> Downloading nvm from git to '/root/.nvm'
=> Cloning into '/root/.nvm'...
* (HEAD detached at FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

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
nvm
    iojs-v1.0.0
    iojs-v1.0.1
    iojs-v1.0.2
    iojs-v1.0.3
    iojs-v1.0.4
    iojs-v1.1.0
    iojs-v1.2.0
    iojs-v1.3.0
    iojs-v1.4.1
    iojs-v1.4.2
    iojs-v1.4.3
    iojs-v1.5.0
    iojs-v1.5.1
    iojs-v1.6.0
    iojs-v1.6.1
    iojs-v1.6.2
    iojs-v1.6.3
    iojs-v1.6.4
    iojs-v1.7.1
    iojs-v1.8.1
    iojs-v1.8.2
    iojs-v1.8.3
    iojs-v1.8.4
    iojs-v2.0.0
    iojs-v2.0.1
    iojs-v2.0.2
    iojs-v2.1.0
    iojs-v2.2.0
    iojs-v2.2.1
    iojs-v2.3.0
    iojs-v2.3.1
    iojs-v2.3.2
    iojs-v2.3.3
    iojs-v2.3.4
    iojs-v2.4.0
    iojs-v2.5.0
    iojs-v3.0.0
    iojs-v3.1.0
    iojs-v3.2.0
    iojs-v3.3.0
    iojs-v3.3.1
Error: building at STEP "RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && . ~/.bashrc && nvm ls-remote": while running runtime: exit status 3

vitorstone avatar Apr 16 '24 17:04 vitorstone

@vitorstone and what happens if you run curl -I --compressed -v https://nodejs.org/dist/ in that container?

ljharb avatar Apr 16 '24 18:04 ljharb

I had the same issue and it was because of internet censorship in my country, If you are in this situation, tunnel your system traffic with a proxy(Socks, HTTP, etc). also, you can use all_proxy, http_proxy, https_proxy environment variables to set your proxy.

export all_proxy=http://<proxy_server_ip>:<proxy_server:port>
export http_proxy=http://<proxy_server_ip>:<proxy_server:port>
export https_proxy=http://<proxy_server_ip>:<proxy_server:port>

vector-mj avatar Apr 18 '24 11:04 vector-mj