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 ls-remote shows only list of iojs and no versions of node (macOS) #3381

Closed
showcup opened this issue Jun 23, 2024 · 11 comments
Closed

nvm ls-remote shows only list of iojs and no versions of node (macOS) #3381

showcup opened this issue Jun 23, 2024 · 11 comments
Labels
installing node Issues with installing node/io.js versions. non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated.

Comments

@showcup
Copy link

showcup commented Jun 23, 2024

Operating system and version:

nvm debug output:

nvm --version: v0.39.7
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'fengjiahua'
${HOME}: /Users/fengjiahua
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: /opt/homebrew/opt/mysql-client/bin:${NVM_DIR}/versions/node/v21.5.0/bin:${HOME}/.gvm/bin:${HOME}/.sdkman/candidates/tomcat/current/bin:${HOME}/.sdkman/candidates/maven/current/bin:${HOME}/.sdkman/candidates/java/current/bin:${HOME}/.sdkman/candidates/groovy/current/bin:${HOME}/.sdkman/candidates/gradle/current/bin:${HOME}/bin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/iTerm.app/Contents/Resources/utilities:${HOME}/Library/Application:Support/JetBrains/Toolbox/scripts
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: 'https://npm.taobao.org/mirrors/node'
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (x86_64-apple-darwin23.0)'
uname -a: 'Darwin 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8103 arm64'
checksum binary: 'shasum'
OS version: macOS 14.2.1 23C71
awk: /usr/bin/awk, awk version 20200816
curl: /usr/bin/curl, curl 8.4.0 (x86_64-apple-darwin23.0) libcurl/8.4.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.55.1
wget: /opt/homebrew/bin/wget, GNU Wget 1.24.5 在 darwin23.2.0 上编译。
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /usr/bin/git, git version 2.39.3 (Apple Git-145)
ls: grep:: No such file or directory
grep: grep: aliased to grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} (grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}), grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
nvm current: v21.5.0
which node: ${NVM_DIR}/versions/node/v21.5.0/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v21.5.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v21.5.0
npm root -g: ${NVM_DIR}/versions/node/v21.5.0/lib/node_modules

nvm ls output:

->      v21.5.0
default -> node (-> v21.5.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v21.5.0) (default)
stable -> 21.5 (-> v21.5.0) (default)
lts/* -> lts/iron (-> 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.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.19.0 (-> N/A)
lts/iron -> v20.10.0 (-> N/A)

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

What steps did you perform?

nvm install 16.17.1

What happened?

Version '16.17.1' not found - try nvm ls-remote to browse available versions.

What did you expect to happen?

nvm ls-remote returns the following:
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
expect a list of available node versions to install

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

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

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...
* Connected to nodejs.org (104.20.23.46) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=*.nodejs.org
*  start date: Feb 28 00:00:00 2024 GMT
*  expire date: Mar 30 23:59:59 2025 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 HTTP/2
* [HTTP/2] [1] OPENED stream for https://nodejs.org/dist/
* [HTTP/2] [1] [:method: HEAD]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: nodejs.org]
* [HTTP/2] [1] [:path: /dist/]
* [HTTP/2] [1] [user-agent: curl/8.4.0]
* [HTTP/2] [1] [accept: */*]
* [HTTP/2] [1] [accept-encoding: deflate, gzip]
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> User-Agent: curl/8.4.0
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/2 200
HTTP/2 200
< date: Sun, 23 Jun 2024 04:48:36 GMT
date: Sun, 23 Jun 2024 04:48:36 GMT
< content-type: text/html
content-type: text/html
< cache-control: public, max-age=3600, s-maxage=14400
cache-control: public, max-age=3600, s-maxage=14400
< last-modified: Sun, 23 Jun 2024 03:36:03 GMT
last-modified: Sun, 23 Jun 2024 03:36:03 GMT
< cf-cache-status: HIT
cf-cache-status: HIT
< age: 3960
age: 3960
< vary: Accept-Encoding
vary: Accept-Encoding
< strict-transport-security: max-age=31536000; includeSubDomains; preload
strict-transport-security: max-age=31536000; includeSubDomains; preload
< x-content-type-options: nosniff
x-content-type-options: nosniff
< server: cloudflare
server: cloudflare
< cf-ray: 8981d8c2cede5a5e-IAD
cf-ray: 8981d8c2cede5a5e-IAD
< content-encoding: gzip
content-encoding: gzip

<
* Connection #0 to host nodejs.org left intact
@ljharb
Copy link
Member

ljharb commented Jun 23, 2024

What does nvm_ls_remote print out? (note the underscores)

@showcup
Copy link
Author

showcup commented Jun 23, 2024

What does nvm_ls_remote print out? (note the underscores)

nvm ls-remote returns the following:
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

@ljharb
Copy link
Member

ljharb commented Jun 23, 2024

not nvm ls-remote, nvm_ls_remote

@showcup
Copy link
Author

showcup commented Jun 24, 2024

not nvm ls-remote, nvm_ls_remote

The output is N/A

@ljharb
Copy link
Member

ljharb commented Jun 24, 2024

Essentially this means it's unable to get a listing from https://nodejs.org/dist - presumably nvm_ls_remote_index_tab node std '' returns N/A as well?

I'm happy to try to debug this further; the curl -I --compressed -v https://nodejs.org/dist/ command in your OP worked, which is strange. Do you have anything set in ~/.curlrc that would make the curl command pass, but nvm's curl commands (which ignore curlrc) fail?

For example, does a working internet connection require a proxy or something?

@showcup
Copy link
Author

showcup commented Jun 24, 2024

Essentially this means it's unable to get a listing from https://nodejs.org/dist - presumably nvm_ls_remote_index_tab node std '' returns N/A as well?

I'm happy to try to debug this further; the curl -I --compressed -v https://nodejs.org/dist/ command in your OP worked, which is strange. Do you have anything set in ~/.curlrc that would make the curl command pass, but nvm's curl commands (which ignore curlrc) fail?

For example, does a working internet connection require a proxy or something?

My computer does not have the ~/.curlrc file.

I believe the request to https://nodejs.org/dist/ is okay. In the web browser, access https://nodejs.org/dist/, refer to the screenshot below.
image
The curl command accessing https://nodejs.org/dist/ also works normally, It a longer duration, But it's fast in the browser. Please see the attached screenshot for reference.
image

No Proxy were started during the above tests.

@ljharb
Copy link
Member

ljharb commented Jun 24, 2024

The actual file nvm requests is https://nodejs.org/dist/index.tab, if that has different results. Not sure how else to help tho :-/

@showcup
Copy link
Author

showcup commented Jun 24, 2024

The actual file nvm requests is https://nodejs.org/dist/index.tab, if that has different results. Not sure how else to help tho :-/

Does nvm generate log files?

@ljharb
Copy link
Member

ljharb commented Jun 24, 2024

No. You can set -x and see a ton of extra output, though.

@frankshaka
Copy link

I resolved this by removing the following line of environment variable definition in my bash profile:

export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node

This issue may be related to the recent ban against NPM/Docker mirror sites within China mainland.

@ljharb
Copy link
Member

ljharb commented Jun 28, 2024

aha, I missed that in your OP's nvm debug output. Either way I'd assume it'd need https, but certainly if China has blocked a site then there's nothing that nvm can do about it.

Glad you figured it out!

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2024
@ljharb ljharb added installing node Issues with installing node/io.js versions. non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated. labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions. non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated.
Projects
None yet
Development

No branches or pull requests

3 participants