Skip to content

nvm install not work #3583

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

Closed
xdewx opened this issue May 8, 2025 · 7 comments
Closed

nvm install not work #3583

xdewx opened this issue May 8, 2025 · 7 comments

Comments

@xdewx
Copy link

xdewx commented May 8, 2025

Operating system and version:

nvm debug output:

nvm --version: v0.40.3
$SHELL: /usr/bin/zsh
$SHLVL: 1
${NVM_DIR}: '${HOME}/.nvm'
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: 'http://npm.taobao.org/mirrors/node'
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (x86_64-debian-linux-gnu)'
uname -a: 'Linux 6.12.20-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.12.20-1kali1 (2025-03-26) x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Kali GNU/Linux Rolling  
awk: /usr/bin/awk, GNU Awk 5.2.1, API 3.2, PMA Avon 8-g1, (GNU MPFR 4.2.2, GNU MP 6.3.0)
curl: /usr/bin/curl, curl 8.13.0 (x86_64-pc-linux-gnu) libcurl/8.13.0 GnuTLS/3.8.9 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 libidn2/2.3.8 libpsl/0.21.2 libssh2/1.11.1 nghttp2/1.64.0 ngtcp2/1.11.0 nghttp3/1.8.0 librtmp/2.3 OpenLDAP/2.6.9
wget: /usr/bin/wget, GNU Wget 1.25.0 在 linux-gnu 上编译。
git: /usr/bin/git, git version 2.47.2
ls: 无法访问 'grep:': 没有那个文件或目录
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 (GNU grep) 3.11
sed: /usr/bin/sed, sed (GNU sed) 4.9
cut: /usr/bin/cut, cut (GNU coreutils) 9.7
basename: /usr/bin/basename, basename (GNU coreutils) 9.7
ls: 无法访问 'rm:': 没有那个文件或目录
rm: rm: aliased to rm -i (rm -i), rm (GNU coreutils) 9.7
mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 9.7
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.10.0
nvm current: v16.20.0
which node: ${NVM_DIR}/versions/node/v16.20.0/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v16.20.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v16.20.0
npm root -g: ${NVM_DIR}/versions/node/v16.20.0/lib/node_modules

nvm ls output:

>     v16.20.0
default -> 16 (-> v16.20.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v16.20.0) (default)
stable -> 16.20 (-> v16.20.0) (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.3 (-> N/A)
lts/gallium -> v16.20.0
lts/hydrogen -> v18.16.0 (-> N/A)

How did you install nvm?

What steps did you perform?

What happened?

can't install node

What did you expect to happen?

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

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

* Uses proxy env variable no_proxy == '192.168.0.0/16,127.0.0.1,172.0.0.0/8,10.0.0.0/8'
* Host nodejs.org:443 was resolved.
* IPv6: 2606:4700:10::ac42:8074, 2606:4700:10::6814:306
* IPv4: 172.66.128.116, 104.20.3.6
*   Trying [2606:4700:10::ac42:8074]:443...
* Immediate connect fail for 2606:4700:10::ac42:8074: 网络不可达
*   Trying [2606:4700:10::6814:306]:443...
* Immediate connect fail for 2606:4700:10::6814:306: 网络不可达
*   Trying 172.66.128.116:443...
* GnuTLS priority: NORMAL:-ARCFOUR-128:-CTYPE-ALL:+CTYPE-X509:-VERS-SSL3.0
* ALPN: curl offers h2,http/1.1
* found 150 certificates in /etc/ssl/certs/ca-certificates.crt
* found 452 certificates in /etc/ssl/certs
* SSL connection using TLS1.3 / ECDHE_RSA_AES_256_GCM_SHA384
*   server certificate verification OK
*   server certificate status verification SKIPPED
*   common name: *.nodejs.org (matched)
*   server certificate expiration date OK
*   server certificate activation date OK
*   certificate public key: RSA
*   certificate version: #3
*   subject: CN=*.nodejs.org
*   start date: Wed, 12 Mar 2025 00:00:00 GMT
*   expire date: Sun, 12 Apr 2026 23:59:59 GMT
*   issuer: C=GB,ST=Greater Manchester,L=Salford,O=Sectigo Limited,CN=Sectigo RSA Domain Validation Secure Server CA
* ALPN: server accepted h2
* Connected to nodejs.org (172.66.128.116) port 443
* 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.13.0]
* [HTTP/2] [1] [accept: */*]
* [HTTP/2] [1] [accept-encoding: deflate, gzip, br, zstd]
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> User-Agent: curl/8.13.0
> Accept: */*
> Accept-Encoding: deflate, gzip, br, zstd
> 
* Request completely sent off
< HTTP/2 200 
HTTP/2 200 
< date: Thu, 08 May 2025 12:04:22 GMT
date: Thu, 08 May 2025 12:04:22 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: Thu, 08 May 2025 11:05:18 GMT
last-modified: Thu, 08 May 2025 11:05:18 GMT
< cf-cache-status: HIT
cf-cache-status: HIT
< age: 3394
age: 3394
< 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: 93c8d1bb09810909-LAX
cf-ray: 93c8d1bb09810909-LAX
< content-encoding: br
content-encoding: br
< 
@ljharb
Copy link
Member

ljharb commented May 8, 2025

The curl command didn’t complete, unless perhaps the full output wasn’t provided? Also, what happens when you try to install node?

@xdewx
Copy link
Author

xdewx commented May 8, 2025

The curl command didn’t complete, unless perhaps the full output wasn’t provided? Also, what happens when you try to install node?

the curl output is complete indeed.
and nvm install 20 gives version not found, run nvm ls_remote , but ls_remote outputs jsxx like.

@ljharb
Copy link
Member

ljharb commented May 8, 2025

it looks like you're overriding the default node mirror source, and pointing to http://npm.taobao.org/mirrors/node - but that URL 404s.

@xdewx
Copy link
Author

xdewx commented May 9, 2025

it looks like you're overriding the default node mirror source, and pointing to http://npm.taobao.org/mirrors/node - but that URL 404s.

Thank u. After unset NVM_NODEJS_ORG_MIRROR, nvm install works.

But as chinese users , we often use china mirrors to improve download speed. So if i want to use https://registry.npmmirror.com/node, how can we set the related env variables?

@xdewx
Copy link
Author

xdewx commented May 9, 2025

The curl command didn’t complete, unless perhaps the full output wasn’t provided? Also, what happens when you try to install node?

By the way, i have another pc, curl output is

❯ curl -I --compressed -v https://nodejs.org/dist/
* Uses proxy env variable no_proxy == '192.168.0.0/16,127.0.0.1,172.0.0.0/8,10.0.0.0/8'
*   Trying 172.66.128.116:443...
*   Trying 2606:4700:10::6814:306:443...
* Immediate connect fail for 2606:4700:10::6814:306: 网络不可达
*   Trying 2606:4700:10::ac42:8074:443...
* Immediate connect fail for 2606:4700:10::ac42:8074: 网络不可达
* connect to 172.66.128.116 port 443 failed: 没有到主机的路由
*   Trying 104.20.3.6:443...
* Connected to nodejs.org (104.20.3.6) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /usr/local/share/anaconda3/ssl/cacert.pem
*  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.nodejs.org
*  start date: Mar 12 00:00:00 2025 GMT
*  expire date: Apr 12 23:59:59 2026 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
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55e5db1e99b0)
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> user-agent: curl/7.78.0
> accept: */*
> accept-encoding: deflate, gzip
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 200 
HTTP/2 200 
< date: Fri, 09 May 2025 03:10:11 GMT
date: Fri, 09 May 2025 03:10:11 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: Fri, 09 May 2025 00:00:19 GMT
last-modified: Fri, 09 May 2025 00:00:19 GMT
< cf-cache-status: HIT
cf-cache-status: HIT
< age: 11282
age: 11282
< 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: 93ce009b8cf47c21-LAX
cf-ray: 93ce009b8cf47c21-LAX
< content-encoding: gzip
content-encoding: gzip

< 
* Connection #0 to host nodejs.org left intact

I found nodejs.org is behind cloudflare, the ip address of nodejs is resolved as 172.66.xx.xx, which conflicts with my docker network.

@ljharb
Copy link
Member

ljharb commented May 9, 2025

To use a mirror, the mirror has to have the exact same structure as nodejs.org - a URL, followed by dist/, that has all the same files in it. It doesn't seem like taobao has the proper structure.

I'll close this, but if you find a correctly structured mirror and still have trouble, I'm happy to reopen this.

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2025
@Amirrznjd

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants