nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

macOS curl: (22) The requested URL returned error: 404

Xhhhhhhhhhhhhh opened this issue · comments

Operating system and version:

macOS 14.2.1 (23C71)
nvm 0.39.7

nvm debug output:

nvm --version: v0.39.7
$TERM_PROGRAM: Apple_Terminal
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'xh36'
${HOME}: /Users/xh36
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${HOME}/.rd/bin:${NVM_DIR}/versions/node/v16.18.1/bin:${HOME}/.rd/bin:/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home/bin:/Applications/xh36/apache-maven-3.9.4/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/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:/Library/Apple/usr/bin:/opt/knightedge/bin:/usr/local/mysql/bin:.:${HOME}/.local/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: 'https://nodejs.org/dist'
$NVM_IOJS_ORG_MIRROR: 'http://npm.taobao.org/mirrors/iojs'
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.21.4 在 darwin23.0.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)
grep: /usr/bin/grep, grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
nvm current: v16.18.1
which node: ${NVM_DIR}/versions/node/v16.18.1/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v16.18.1/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v16.18.1
npm root -g: ${NVM_DIR}/versions/node/v16.18.1/lib/node_modules

nvm ls output:

      v12.22.12
       v14.15.0
->     v16.18.1
       v16.20.1
       v18.16.1
       v20.11.0
       v20.12.2
         system
default -> v16.18.1
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.12.2) (default)
stable -> 20.12 (-> v20.12.2) (default)
lts/* -> lts/iron (-> v20.12.2)
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
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.2 (-> N/A)
lts/iron -> v20.12.2

How did you install nvm?

by curl

What steps did you perform?

nvm install 14 --lts

What happened?

Downloading and installing node v14.21.3...
Downloading https://nodejs.org/dist/v14.21.3/node-v14.21.3-darwin-arm64.tar.xz...
curl: (22) The requested URL returned error: 404                                                                                         

Binary download from https://nodejs.org/dist/v14.21.3/node-v14.21.3-darwin-arm64.tar.xz failed, trying source.
grep: /Users/xh36/.nvm/.cache/bin/node-v14.21.3-darwin-arm64/node-v14.21.3-darwin-arm64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Additional options while compiling:  --lts
Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!
Local cache found: ${NVM_DIR}/.cache/src/node-v14.21.3/node-v14.21.3.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v14.21.3/node-v14.21.3.tar.xz
$>./configure --prefix=/Users/xh36/.nvm/versions/node/v14.21.3 --lts<
Node.js configure: Found Python 3.9.6...
Usage: configure [options]

configure: error: no such option: --lts
nvm: install v14.21.3 failed!

What did you expect to happen?

I think nvm should download the latest version of node14

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

export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/npm/ # 修改镜像
export NVM_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojs
export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist

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: Mon, 22 Apr 2024 06:20:44 GMT
date: Mon, 22 Apr 2024 06:20:44 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: Mon, 22 Apr 2024 01:05:19 GMT
last-modified: Mon, 22 Apr 2024 01:05:19 GMT
< cf-cache-status: HIT
cf-cache-status: HIT
< age: 7675
age: 7675
< 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: 8783827c0e933125-LAX
cf-ray: 8783827c0e933125-LAX
< content-encoding: gzip
content-encoding: gzip

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

There are no binaries for that - before node 16, you need to be on Rosetta. See the readme.